mxfusion.components.functions.gluon_func_eval

Members

class mxfusion.components.functions.gluon_func_eval.GluonFunctionEvaluation(function_wrapper, input_variables, block_variables, output_variables, broadcastable=False)

Bases: mxfusion.components.functions.function_evaluation.FunctionEvaluation

The evaluation of a function that is a wrapper of a MXNet Gluon block.

Parameters:
  • function_wrapper (MXFusion.functions.MXFusionGluonFunction) – the MXFusion wrapper of the MXNet Gluon block that the function evaluation is associated with.
  • input_variables ({variable name : Variable}) – the input arguments to the function.
  • block_variables ({variable name : Variable}) – the parameters in the Gluon block.
  • nOutputs (int) – the number of outputs of the function.
  • broadcastable – Whether the function supports broadcasting with the additional dimension for samples.
Type:

boolean

block_variables
replicate_self(attribute_map=None)

This functions is a copy constructor for the object. In order to perform copy construction we first call __new__() on the class which creates a blank object. We then initialize that object using the method’s standard init procedures, and do any extra copying of attributes.

Replicates this Factor, using new inputs, outputs, and a new uuid. Used during model replication to functionally replicate a factor into a new graph.

Parameters:
  • inputs (List of tuples of name to node e.g. [('random_variable': Variable y)] or None) – new input variables of the factor.
  • outputs (List of tuples of name to node e.g. [('random_variable': Variable y)] or None) – new output variables of the factor.
eval(F, variables, always_return_tuple=False)

The method handling the execution of the function. The inputs arguments of the function are fetched from the variables argument according to their UUIDs.

Parameters:
  • F – the MXNet computation mode (mxnet.symbol or mxnet.ndarray)
  • variables ({str(UUID): MXNet NDArray or MXNet Symbol}) – the set of MXNet arrays that holds the values of variables at runtime.
  • always_return_tuple – Whether return a tuple even if there is

only one variables in outputs. :type always_return_tuple: boolean :returns: the return value of the function :rtypes: MXNet NDArray or MXNet Symbol