From d788cc8c54ac5efbe49cc4b947e8d7d8101cc351 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Tue, 30 May 2017 16:59:12 +0100 Subject: [PATCH] remove old imap --- src/backend/mxnet/graph.jl | 4 ++-- src/backend/tensorflow/graph.jl | 3 +-- src/compiler/interp.jl | 10 ---------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/backend/mxnet/graph.jl b/src/backend/mxnet/graph.jl index 8b178d61..4f6a494b 100644 --- a/src/backend/mxnet/graph.jl +++ b/src/backend/mxnet/graph.jl @@ -10,7 +10,7 @@ using Base: @get! using DataFlow: Constant, constant using DataFlow.Interpreter using DataFlow.Interpreter: Exception, totrace -using Flux: imap, mapt +using Flux: mapt # TODO: implement Julia's type promotion rules @@ -92,7 +92,7 @@ end graph′(ctx::Context, args...) = @icatch ctx graph(ctx, args...) function tograph(model, args...; feedforward = false) - ctx = Context(mux(iline, ilambda, imap, iargs, ituple, graph′), + ctx = Context(mux(iline, ilambda, iargs, ituple, graph′), params = Dict(), stacks = Dict(), feedforward = feedforward) out = @ithrow graph(ctx, model, mapt(mx.Variable, args)...) diff --git a/src/backend/tensorflow/graph.jl b/src/backend/tensorflow/graph.jl index 28965646..20c3c472 100644 --- a/src/backend/tensorflow/graph.jl +++ b/src/backend/tensorflow/graph.jl @@ -2,7 +2,6 @@ using Base: @get! using DataFlow: Constant, constant, Split using DataFlow.Interpreter using DataFlow.Interpreter: stack -using Flux: imap using TensorFlow: RawTensor, TFException # TODO: implement Julia's type promotion rules @@ -79,7 +78,7 @@ function interp(ctx, model, args...) end function tograph(model, args...; variables = false) - ctx = Context(mux(iline, ilambda, imap, interp), + ctx = Context(mux(iline, ilambda, interp), params = ObjectIdDict(), stacks = Dict(), variables = variables) out = interp(ctx, model, map(constant, args)...) return ctx[:params], ctx[:stacks], out diff --git a/src/compiler/interp.jl b/src/compiler/interp.jl index 4a35fd72..f3fe4a21 100644 --- a/src/compiler/interp.jl +++ b/src/compiler/interp.jl @@ -13,16 +13,6 @@ function astuples(xs) all(x->!(x==nothing), xs) ? xs : nothing end -function imap(cb, ctx, ::typeof(map), f, xs...) - f, xs = interpv(ctx, (f, xs)) - xs′ = astuples(xs) - xs′ ≠ nothing ? - group(map(f, xs′...)...) : - cb(ctx, map, constant(f), xs...) -end - -imap(f, args...) = f(args...) - function interp(ctx, f, xs...) g = graph(f) @icatch(ctx, g ≠ nothing ?