From 521258eb0855cd4c1ce215c20a1d91d7080f86d1 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Tue, 21 Feb 2017 08:56:05 +0000 Subject: [PATCH] more intuitive naming --- src/backend/mxnet/graph.jl | 6 +++--- src/compiler/interp.jl | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backend/mxnet/graph.jl b/src/backend/mxnet/graph.jl index ebc5c5b1..879f612f 100644 --- a/src/backend/mxnet/graph.jl +++ b/src/backend/mxnet/graph.jl @@ -69,17 +69,17 @@ graph(ctx::Context, p::Constant) = node(p.value) function graph(ctx::Context, model, args...) g = Flux.graph(model) - g == nothing && return register(ctx, @ithrow ctx graph(model, args...)) + g == nothing && return register(ctx, @icatch ctx graph(model, args...)) DataFlow.iscyclic(g) && error("This model has a cycle; try unrolling it first.") interpret(ctx, g, args...) end -graph′(ctx::Context, args...) = @ithrow ctx graph(ctx, args...) +graph′(ctx::Context, args...) = @icatch ctx graph(ctx, args...) function tograph(model, args...) ctx = Context(mux(iline, ilambda, imap, iargs, ituple, graph′), params = Dict(), stacks = Dict()) - out = @icatch graph(ctx, model, args...) + out = @ithrow graph(ctx, model, args...) return ctx[:params], ctx[:stacks], out end diff --git a/src/compiler/interp.jl b/src/compiler/interp.jl index 3607ad6c..6f7e3d50 100644 --- a/src/compiler/interp.jl +++ b/src/compiler/interp.jl @@ -27,7 +27,7 @@ imap(f, args...) = f(args...) function interp(ctx, f, xs...) g = graph(f) - @ithrow(ctx, g ≠ nothing ? + @icatch(ctx, g ≠ nothing ? interpret(ctx, reifyparams(g), xs...) : f(xs...)) end @@ -36,7 +36,7 @@ end function interpmodel(m, args::Batch...) ctx = Context(mux(iline, ilambda, iconst, iargs, ituple, interp)) - rebatch(@icatch interp(ctx, m, map(rawbatch, args)...)) + rebatch(@ithrow interp(ctx, m, map(rawbatch, args)...)) end interpmodel(m, args...) = unbatchone(interpmodel(m, batchone(args)...))