From 00a5acde462446b4832da423e8dd4ccfda90632a Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Wed, 1 Feb 2017 17:06:42 +0530 Subject: [PATCH] fixes --- src/compiler/interp.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/interp.jl b/src/compiler/interp.jl index 22ea5379..3607ad6c 100644 --- a/src/compiler/interp.jl +++ b/src/compiler/interp.jl @@ -26,14 +26,17 @@ end imap(f, args...) = f(args...) function interp(ctx, f, xs...) - @ithrow ctx f(xs...) + g = graph(f) + @ithrow(ctx, g ≠ nothing ? + interpret(ctx, reifyparams(g), xs...) : + f(xs...)) end # TODO: batching should be secondary function interpmodel(m, args::Batch...) ctx = Context(mux(iline, ilambda, iconst, iargs, ituple, interp)) - rebatch(@icatch interpret(ctx, reifyparams(graph(m)), map(rawbatch, args)...)) + rebatch(@icatch interp(ctx, m, map(rawbatch, args)...)) end interpmodel(m, args...) = unbatchone(interpmodel(m, batchone(args)...))