mxnet
Public Types | Public Member Functions | Public Attributes | List of all members
mxnet::op::SimpleOpRegEntry Class Referenceabstract

registry entry to register simple operators via functions. More...

#include <operator_util.h>

Collaboration diagram for mxnet::op::SimpleOpRegEntry:
Collaboration graph

Public Types

typedef SimpleOpRegEntry TSelf
 declare self type More...
 

Public Member Functions

virtual TSelfset_symbol_op_name (char const *symbol_name)=0
 set a seperate name for symbol This must be called before set_function. Default: this is set to be same as the name of operator. More...
 
virtual TSelfset_enable_scalar (bool enable_scalar, SimpleOpScalarOption type_mask=kArrayBeforeScalar)=0
 set number of scalar arguments needed to be passed in env A function cannot have both kwargs and scalar arguments. Default: this is set to false More...
 
virtual TSelfset_enable_kwargs (bool enable_kwargs)=0
 set whether to enable kwargs A function cannot have both kwargs and scalar arguments. Default: this is set to false More...
 
virtual TSelfset_resource_request (const std::vector< ResourceRequest > &reqs)=0
 set resource request By default there is no resource request. The resource will be presented in both forward and backward. More...
 
virtual TSelfset_resource_request (ResourceRequest req)=0
 set resource request By default there is no resource request. The resource will be presented in both forward and backward. More...
 
virtual TSelfset_shape_function (SourceShapeFunction fshapeinfer)=0
 set source inference function. More...
 
virtual TSelfset_shape_function (UnaryShapeFunction fshapeinfer)=0
 set shape inference function. Default: out_shape = in_shape More...
 
virtual TSelfset_shape_function (BinaryShapeFunction fshapeinfer)=0
 set shape inference function to be the binary inference function Default: out_shape = lhs_shape, and lhs_shape must equal rhs_shape. More...
 
virtual TSelfset_function (int dev_mask, SourceFunction fsource, SimpleOpRegOption register_symbolic=kRegisterSymbolic)=0
 set function of the function to be fsource More...
 
virtual TSelfset_function (int dev_mask, UnaryFunction funary, SimpleOpInplaceOption inplace_in_out, SimpleOpRegOption register_symbolic=kRegisterSymbolic)=0
 set function of the function to be funary More...
 
virtual TSelfset_function (int dev_mask, BinaryFunction fbinary, SimpleOpInplaceOption inplace_lhs_out, SimpleOpRegOption register_symbolic=kRegisterSymbolic)=0
 set function of the function to be funary More...
 
virtual TSelfset_gradient (int dev_mask, UnaryGradFunctionT0 fgrad, SimpleOpInplaceOption inplace_out_in_grad)=0
 set gradient of the function of this function. More...
 
virtual TSelfset_gradient (int dev_mask, UnaryGradFunctionT1 fgrad, SimpleOpInplaceOption inplace_out_in_grad)=0
 set gradient of the function of this function. More...
 
virtual TSelfset_gradient (int dev_mask, UnaryGradFunctionT2 fgrad, SimpleOpInplaceOption inplace_out_in_grad)=0
 set gradient of the function of this function. More...
 
virtual TSelfset_gradient (int dev_mask, BinaryGradFunctionT0 fgrad, SimpleOpInplaceOption inplace_out_lhs_grad)=0
 set gradient of the function of this function. More...
 
virtual TSelfset_gradient (int dev_mask, BinaryGradFunctionT1 fgrad, SimpleOpInplaceOption inplace_out_lhs_grad)=0
 set gradient of the function of this function. More...
 
virtual TSelfdescribe (const std::string &description)=0
 Describe the function. More...
 
virtual TSelfadd_arguments (const std::vector< dmlc::ParamFieldInfo > &args)=0
 Describe the function. More...
 
virtual ~SimpleOpRegEntry ()
 virtual destructor More...
 

Public Attributes

std::string name
 name of the operator More...
 

Detailed Description

registry entry to register simple operators via functions.

Member Typedef Documentation

declare self type

Constructor & Destructor Documentation

virtual mxnet::op::SimpleOpRegEntry::~SimpleOpRegEntry ( )
inlinevirtual

virtual destructor

Member Function Documentation

virtual TSelf& mxnet::op::SimpleOpRegEntry::add_arguments ( const std::vector< dmlc::ParamFieldInfo > &  args)
pure virtual

Describe the function.

Parameters
argsargument information. Add additional arguments to the function.
Returns
reference to self.
virtual TSelf& mxnet::op::SimpleOpRegEntry::describe ( const std::string &  description)
pure virtual

Describe the function.

Parameters
descriptionThe description of the function.
Returns
reference to self.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_enable_kwargs ( bool  enable_kwargs)
pure virtual

set whether to enable kwargs A function cannot have both kwargs and scalar arguments. Default: this is set to false

Parameters
enable_kwargswhether to enable kwargs
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_enable_scalar ( bool  enable_scalar,
SimpleOpScalarOption  type_mask = kArrayBeforeScalar 
)
pure virtual

set number of scalar arguments needed to be passed in env A function cannot have both kwargs and scalar arguments. Default: this is set to false

Parameters
enable_scalarwhether to enable scalar argument
type_maskthe position of the scalar argument.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_function ( int  dev_mask,
SourceFunction  fsource,
SimpleOpRegOption  register_symbolic = kRegisterSymbolic 
)
pure virtual

set function of the function to be fsource

Parameters
dev_maskThe device mask of the function can act on.
fsourceThe unary function that peforms the operation.
register_symbolicWhether register a symbolic operator as well.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_function ( int  dev_mask,
UnaryFunction  funary,
SimpleOpInplaceOption  inplace_in_out,
SimpleOpRegOption  register_symbolic = kRegisterSymbolic 
)
pure virtual

set function of the function to be funary

Parameters
dev_maskThe device mask of the function can act on.
funaryThe unary function that peforms the operation.
inplace_in_outWhether do inplace optimization on in and out.
register_symbolicWhether register a symbolic operator as well.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_function ( int  dev_mask,
BinaryFunction  fbinary,
SimpleOpInplaceOption  inplace_lhs_out,
SimpleOpRegOption  register_symbolic = kRegisterSymbolic 
)
pure virtual

set function of the function to be funary

Parameters
dev_maskThe device mask of the function can act on.
fbinaryThe binary function that peforms the operation.
inplace_lhs_outWhether do inplace optimization on lhs and out.
register_symbolicWhether register a symbolic operator as well.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_gradient ( int  dev_mask,
UnaryGradFunctionT0  fgrad,
SimpleOpInplaceOption  inplace_out_in_grad 
)
pure virtual

set gradient of the function of this function.

Parameters
dev_maskThe device mask of the function can act on.
fgradThe gradient function to be set.
inplace_out_in_gradwhether out_grad and in_grad can share memory.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_gradient ( int  dev_mask,
UnaryGradFunctionT1  fgrad,
SimpleOpInplaceOption  inplace_out_in_grad 
)
pure virtual

set gradient of the function of this function.

Parameters
dev_maskThe device mask of the function can act on.
fgradThe gradient function to be set.
inplace_out_in_gradwhether out_grad and in_grad can share memory.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_gradient ( int  dev_mask,
UnaryGradFunctionT2  fgrad,
SimpleOpInplaceOption  inplace_out_in_grad 
)
pure virtual

set gradient of the function of this function.

Parameters
dev_maskThe device mask of the function can act on.
fgradThe gradient function to be set.
inplace_out_in_gradwhether out_grad and in_grad can share memory.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_gradient ( int  dev_mask,
BinaryGradFunctionT0  fgrad,
SimpleOpInplaceOption  inplace_out_lhs_grad 
)
pure virtual

set gradient of the function of this function.

Parameters
dev_maskThe device mask of the function can act on.
fgradThe gradient function to be set.
inplace_out_lhs_gradwhether out_grad and lhs_grad can share memory.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_gradient ( int  dev_mask,
BinaryGradFunctionT1  fgrad,
SimpleOpInplaceOption  inplace_out_lhs_grad 
)
pure virtual

set gradient of the function of this function.

Parameters
dev_maskThe device mask of the function can act on.
fgradThe gradient function to be set.
inplace_out_lhs_gradwhether out_grad and lhs_grad can share memory.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_resource_request ( const std::vector< ResourceRequest > &  reqs)
pure virtual

set resource request By default there is no resource request. The resource will be presented in both forward and backward.

Parameters
reqsthe request.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_resource_request ( ResourceRequest  req)
pure virtual

set resource request By default there is no resource request. The resource will be presented in both forward and backward.

Parameters
reqthe request.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_shape_function ( SourceShapeFunction  fshapeinfer)
pure virtual

set source inference function.

Parameters
fshapeinferThe source function that peforms the operation.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_shape_function ( UnaryShapeFunction  fshapeinfer)
pure virtual

set shape inference function. Default: out_shape = in_shape

Parameters
fshapeinferThe unary function that peforms the operation.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_shape_function ( BinaryShapeFunction  fshapeinfer)
pure virtual

set shape inference function to be the binary inference function Default: out_shape = lhs_shape, and lhs_shape must equal rhs_shape.

Parameters
fshapeinferThe binary function that peforms the operation.
virtual TSelf& mxnet::op::SimpleOpRegEntry::set_symbol_op_name ( char const *  symbol_name)
pure virtual

set a seperate name for symbol This must be called before set_function. Default: this is set to be same as the name of operator.

Parameters
symbol_namethe name of symbolic operator.

Member Data Documentation

std::string mxnet::op::SimpleOpRegEntry::name

name of the operator


The documentation for this class was generated from the following file: