NAME

AI::MXNet::Executor - The actual executing object of MXNet.

new

Constructor, used by AI::MXNet::Symbol->bind and by AI::MXNet::Symbol->simple_bind.

Parameters
----------
handle: ExecutorHandle
    ExecutorHandle is generated by calling bind.

See Also
--------
AI::MXNet::Symbol->bind : how to create the AI::MXNet::Executor.

outputs

The output ndarrays bound to this executor.

Returns
-------
An array ref with AI::MXNet::NDArray objects bound to the heads of the executor.

forward

Calculate the outputs specified by the bound symbol.

Parameters
----------
$is_train=0: bool, optional
    whether this forward is for evaluation purpose. If True,
    a backward call is expected to follow. Otherwise following
    backward is invalid.

%kwargs
    Additional specification of input arguments.

Examples
--------
    >>> # doing forward by specifying data
    >>> $texec->forward(1, data => $mydata);
    >>> # doing forward by not specifying things, but copy to the executor before hand
    >>> $mydata->copyto($texec->arg_dict->{'data'});
    >>> $texec->forward(1);
    >>> # doing forward by specifying data and get outputs
    >>> my $outputs = $texec->forward(1, data => $mydata);
    >>> print $outputs->[0]->aspdl;

backward

Do a backward pass to get the gradient of the arguments.

Parameters
----------
out_grads : NDArray or an array ref of NDArrays or hash ref of NDArrays, optional.
    The gradient on the outputs to be propagated back.
    This parameter is only needed when bind is called
    on outputs that are not a loss function.

is_train : bool, default 1
    Whether this backward is for training or inference. Note that in rare
    cases you want to call backward with is_train=0 to get gradient
    during inference.

set_monitor_callback

Install callback.

Parameters
----------
callback : subref
    Takes a string and an NDArrayHandle.

arg_dict

Get a hash ref representation of the argument arrays.

Returns
-------
arg_dict : HashRef[AI::MXNet::NDArray]
    The map that maps a name of the arguments to the NDArrays.

grad_dict

Get a hash ref representation of the gradient arrays.

Returns
-------
grad_dict : HashRef[AI::MXNet::NDArray]
    The map that maps a name of the arguments to the gradient NDArrays.

aux_dict

Get a hash ref representation of the auxiliary states arrays.

Returns
-------
aux_dict : HashRef[AI::MXNet::NDArray]
    The map that maps a name of the auxiliary states to the NDArrays.

output_dict

Get a hash ref representation of the output arrays.

Returns
-------
output_dict : HashRef[AI::MXNet::NDArray]
    The map that maps a name of the outputs to the NDArrays.

copy_params_from

Copy parameters from arg_params, aux_params into the executor's internal array.

Parameters
----------
arg_params : HashRef[AI::MXNet::NDArray]
    Parameters, hash ref of name to NDArray of arguments

aux_params : Maybe[HashRef[AI::MXNet::NDArray]], optional
    Parameters, hash ref of name to NDArray of auxiliary states.

allow_extra_params : boolean, optional
    Whether to allow extra parameters that are not needed by symbol
    If this is True, no error will be thrown when arg_params or aux_params
    contain extra parameters that is not needed by the executor.

reshape

Returns new executor with the same symbol and shared memory,
but different input/output shapes.
For runtime reshaping, variable length sequences, etc.
The returned executor shares state with the current one,
and cannot be used in parallel with it.

Parameters
----------
$kwargs : HashRef[Shape]
    new shape for arguments.
:$partial_shaping : bool
    Whether to allow changing the shape of unspecified arguments.
:$allow_up_sizing : bool
    Whether to allow allocating new ndarrays that's larger than the original.

Returns
-------
$exec : AI::MXNet::Executor
    A new executor that shares memory with self.

debug_str

A debug string about the internal execution plan.

Returns
-------
debug_str : string
    Debug string of the executor.