Executor
# MXNet.mx.Executor
— Type.
Executor
An executor is a realization of a symbolic architecture defined by a SymbolicNode
. The actual forward and backward computation specified by the network architecture can be carried out with an executor.
source
# Base.bind
— Method.
bind(sym, ctx, args; args_grad=Dict(), aux_states=Dict(), grad_req=GRAD_WRITE)
Create an Executor
by binding a SymbolicNode
to concrete NDArray
.
Arguments
-
sym::SymbolicNode
: the network architecture describing the computation graph. -
ctx::Context
: the context on which the computation should run. -
args
: either a list ofNDArray
or a dictionary of name-array pairs. Concrete arrays for all the inputs in the network architecture. The inputs typically include network parameters (weights, bias, filters, etc.), data and labels. Seelist_arguments
andinfer_shape
. -
args_grad
: aVector
ofNDArray
or aDict
containsNDArray
-
aux_states
: aVector
ofNDArray
or aDict
containsNDArray
-
grad_req
: single value, aVector
ofGRAD_REQ
or aDict{Symbol,GRAD_REQ}
source
# Base.print
— Method.
print([io::IO], x::Executor)
Get a debug string about internal execution plan.
Can be used to get an estimated about the memory cost.
julia> x = mx.Variable(:x)
MXNet.mx.SymbolicNode x
julia> exec = mx.bind(x + 1, mx.cpu(), Dict(:x => mx.ones(2,3)))
mx.Executor Ptr{Void} @0x000055c3dee9eb30
julia> print(exec)
Symbol Outputs:
output[0]=_plus_scalar0(0)
Variable:x
--------------------
Op:_plus_scalar, Name=_plus_scalar0
Inputs:
arg[0]=x(0) version=0
Attrs:
scalar=1.00000000e+00
Total 0 MB allocated
Total 11 TempSpace resource requested
source