Table Of Contents
Table Of Contents


mxnet.ndarray.Custom(*data, **kwargs)

Apply a custom operator implemented in a frontend language (like Python).

Custom operators should override required methods like forward and backward. The custom operator must be registered before it can be used. Please check the tutorial here:

Defined in src/operator/custom/

  • data (NDArray[]) – Input data for the custom operator.

  • op_type (string) – Name of the custom operator. This is the name that is passed to mx.operator.register to register the operator.

  • out (NDArray, optional) – The output NDArray to hold the result.


out – The output of this function.

Return type

NDArray or list of NDArrays


Applies a custom operator named my_custom_operator to input.

>>> output = mx.symbol.Custom(op_type='my_custom_operator', data=input)