clean up forward pass interp errors

This commit is contained in:
Mike J Innes 2017-02-01 16:56:53 +05:30
parent cb4912c271
commit 7c450c3200

View File

@ -25,10 +25,15 @@ end
imap(f, args...) = f(args...) imap(f, args...) = f(args...)
function interp(ctx, f, xs...)
@ithrow ctx f(xs...)
end
# TODO: batching should be secondary # TODO: batching should be secondary
function interpmodel(m, args::Batch...) function interpmodel(m, args::Batch...)
rebatch(interpret(reifyparams(graph(m)), map(rawbatch, args)...)) ctx = Context(mux(iline, ilambda, iconst, iargs, ituple, interp))
rebatch(@icatch interpret(ctx, reifyparams(graph(m)), map(rawbatch, args)...))
end end
interpmodel(m, args...) = unbatchone(interpmodel(m, batchone(args)...)) interpmodel(m, args...) = unbatchone(interpmodel(m, batchone(args)...))