Skip to content

Commit

Permalink
executor: return outputs on forward (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
iblislin authored and pluskid committed Nov 9, 2017
1 parent 1fc03f2 commit 00d61d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/executor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,16 @@ function simple_bind(self :: SymbolicNode, ctx :: Context;
end


function forward(self :: Executor; is_train::Bool=false, kwargs...)
function forward(self::Executor; is_train::Bool = false, kwargs...)
for (k,v) in kwargs
@assert(k self.arg_dict, "Unknown argument $k")
@assert(isa(v, NDArray), "Keyword argument $k must be an NDArray")
copy!(self.arg_dict[k], v)
end

@mxcall(:MXExecutorForward, (MX_handle, Cint), self, is_train)

self.outputs
end

function backward(self :: Executor)
Expand Down

0 comments on commit 00d61d2

Please sign in to comment.