mxnet
Classes | Typedefs | Enumerations
mxnet::op Namespace Reference

namespace of arguments More...

Classes

struct  EnvArguments
 Environment arguments that is used by the function. These can be things like scalar arguments when add a value with scalar. More...
 
struct  GradFunctionArgument
 super class of all gradient function argument More...
 
struct  Input0
 First input to the function. More...
 
struct  Input1
 Second input to the function. More...
 
struct  OutputGrad
 Gradient of output value. More...
 
struct  OutputValue
 Ouput value of the function to the function. More...
 
class  SimpleOpRegEntry
 registry entry to register simple operators via functions. More...
 
class  SimpleOpRegistry
 registry for TBlob functions More...
 

Typedefs

typedef void(* SourceFunction) (const EnvArguments &env, TBlob *ret, OpReqType req, RunContext ctx)
 source function that generate output based on env The result container is pre-allocated with the correct shape. More...
 
typedef TShape(* SourceShapeFunction) (const EnvArguments &env)
 Shape inference function to get the correct shape. More...
 
typedef void(* UnaryFunction) (const TBlob &src, const EnvArguments &env, TBlob *ret, OpReqType req, RunContext ctx)
 Unary function that takes a src and save result to ret. The result container is pre-allocated with the correct shape. More...
 
typedef TShape(* UnaryShapeFunction) (const TShape &src, const EnvArguments &env)
 Shape inference function to get the correct shape given source. More...
 
typedef void(* UnaryGradFunctionT0) (const OutputGrad &out_grad, const EnvArguments &env, TBlob *in_grad, OpReqType req, RunContext ctx)
 Gradient function that takes output value of function and computes gradient wrt to input. More...
 
typedef void(* UnaryGradFunctionT1) (const OutputGrad &out_grad, const OutputValue &out_value, const EnvArguments &env, TBlob *in_grad, OpReqType req, RunContext ctx)
 Gradient function that takes output value of function and computes gradient wrt to input. More...
 
typedef void(* UnaryGradFunctionT2) (const OutputGrad &out_grad, const Input0 &in_data0, const EnvArguments &env, TBlob *in_grad, OpReqType req, RunContext ctx)
 Gradient function that takes input value of function and computes gradient wrt to input. More...
 
typedef void(* BinaryFunction) (const TBlob &lhs, const TBlob &rhs, const EnvArguments &env, TBlob *ret, OpReqType req, RunContext ctx)
 Binary function that takes lhs, rhs and save result to ret. The result container is pre-allocated with the correct shape. More...
 
typedef TShape(* BinaryShapeFunction) (const TShape &lhs, const TShape &rhs, const EnvArguments &env)
 Shape inference function to get the correct shape given source shapes. More...
 
typedef void(* BinaryGradFunctionT0) (const OutputGrad &out_grad, const EnvArguments &env, TBlob *lhs_grad, TBlob *rhs_grad, OpReqType req_lhs_grad, OpReqType req_rhs_grad, RunContext ctx)
 Gradient function that takes only output gradient and computes gradient wrt to input. We support total gradient as a whole to make it easy to combine a few ops. More...
 
typedef void(* BinaryGradFunctionT1) (const OutputGrad &out_grad, const Input0 &lhs, const Input1 &rhs, const EnvArguments &env, TBlob *lhs_grad, TBlob *rhs_grad, OpReqType req_lhs_grad, OpReqType req_rhs_grad, RunContext ctx)
 Gradient function that takes inputs of function anod computes gradient wrt to input. More...
 

Enumerations

enum  SimpleOpInplaceOption {
  kNoInplace, kInplaceInOut, kInplaceOutIn, kInplaceLhsOut,
  kInplaceOutLhs
}
 options in the registry to set inplace of operator More...
 
enum  SimpleOpScalarOption { kScalarBeforeArray, kArrayBeforeScalar }
 options in the registry to set symbolic registration More...
 
enum  SimpleOpRegOption { kNotRegisterSymbolic, kRegisterSymbolic }
 options in the registry to set symbolic registration More...
 

Detailed Description

namespace of arguments

Typedef Documentation

typedef void(* mxnet::op::BinaryFunction) (const TBlob &lhs, const TBlob &rhs, const EnvArguments &env, TBlob *ret, OpReqType req, RunContext ctx)

Binary function that takes lhs, rhs and save result to ret. The result container is pre-allocated with the correct shape.

Parameters
lhsThe left operand
rhsThe right operand
envThe Environment arguments.
retThe containter to store return value.
reqThe requirement to stroe the ret.
ctxRuntime context to execute the function.
typedef void(* mxnet::op::BinaryGradFunctionT0) (const OutputGrad &out_grad, const EnvArguments &env, TBlob *lhs_grad, TBlob *rhs_grad, OpReqType req_lhs_grad, OpReqType req_rhs_grad, RunContext ctx)

Gradient function that takes only output gradient and computes gradient wrt to input. We support total gradient as a whole to make it easy to combine a few ops.

Parameters
out_gradthe gradient wrt to output of the function.
envThe Environment arguments.
lhs_gradThe container to store result of lhs gradient.
rhs_gradThe container to store result of lhs gradient.
req_lhs_gradThe requirement to store the lhs_grad
req_rhs_gradThe requirement to store the rhs_grad
ctxRuntime context to execute the function.
typedef void(* mxnet::op::BinaryGradFunctionT1) (const OutputGrad &out_grad, const Input0 &lhs, const Input1 &rhs, const EnvArguments &env, TBlob *lhs_grad, TBlob *rhs_grad, OpReqType req_lhs_grad, OpReqType req_rhs_grad, RunContext ctx)

Gradient function that takes inputs of function anod computes gradient wrt to input.

Parameters
out_gradthe gradient wrt to output of the function.
lhsThe left operand to the function.
rhsThe right operand to the function.
envThe Environment arguments.
lhs_gradThe container to store result of lhs gradient.
rhs_gradThe container to store result of lhs gradient.
req_lhs_gradThe requirement to store the lhs_grad
req_rhs_gradThe requirement to store the rhs_grad
ctxRuntime context to execute the function.
typedef TShape(* mxnet::op::BinaryShapeFunction) (const TShape &lhs, const TShape &rhs, const EnvArguments &env)

Shape inference function to get the correct shape given source shapes.

Parameters
lhsThe shape of left operand.
rhsThe shape of right operand.
envThe Environment arguments.
Returns
The inferred result shape.
typedef void(* mxnet::op::SourceFunction) (const EnvArguments &env, TBlob *ret, OpReqType req, RunContext ctx)

source function that generate output based on env The result container is pre-allocated with the correct shape.

Parameters
envThe Environment arguments.
retThe containter to store return value.
reqThe requirement to stroe the ret.
ctxRuntime context to execute the function.
typedef TShape(* mxnet::op::SourceShapeFunction) (const EnvArguments &env)

Shape inference function to get the correct shape.

Parameters
envThe Environment arguments.
Returns
The inferred result shape.
typedef void(* mxnet::op::UnaryFunction) (const TBlob &src, const EnvArguments &env, TBlob *ret, OpReqType req, RunContext ctx)

Unary function that takes a src and save result to ret. The result container is pre-allocated with the correct shape.

Parameters
srcThe source data.
envThe Environment arguments.
retThe containter to store return value.
reqThe requirement to stroe the ret.
ctxRuntime context to execute the function.
typedef void(* mxnet::op::UnaryGradFunctionT0) (const OutputGrad &out_grad, const EnvArguments &env, TBlob *in_grad, OpReqType req, RunContext ctx)

Gradient function that takes output value of function and computes gradient wrt to input.

Parameters
out_gradthe gradient wrt to output of the function.
envThe Environment arguments.
in_gradThe container to store result input gradient.
reqThe requirement to store the ret value.
ctxRuntime context to execute the function.
typedef void(* mxnet::op::UnaryGradFunctionT1) (const OutputGrad &out_grad, const OutputValue &out_value, const EnvArguments &env, TBlob *in_grad, OpReqType req, RunContext ctx)

Gradient function that takes output value of function and computes gradient wrt to input.

Parameters
out_gradthe gradient wrt to output of the function.
out_valuethe value of the function.
envThe Environment arguments.
in_gradThe container to store result input gradient.
reqThe requirement to store the ret value.
ctxRuntime context to execute the function.
typedef void(* mxnet::op::UnaryGradFunctionT2) (const OutputGrad &out_grad, const Input0 &in_data0, const EnvArguments &env, TBlob *in_grad, OpReqType req, RunContext ctx)

Gradient function that takes input value of function and computes gradient wrt to input.

Parameters
out_gradthe gradient wrt to output of the function.
in_data0the input value of the function.
envThe Environment arguments.
in_gradThe container to store result input gradient.
reqThe requirement to store the ret value.
ctxRuntime context to execute the function.
typedef TShape(* mxnet::op::UnaryShapeFunction) (const TShape &src, const EnvArguments &env)

Shape inference function to get the correct shape given source.

Parameters
srcThe source shape
envThe Environment arguments.
Returns
The inferred result shape.

Enumeration Type Documentation

options in the registry to set inplace of operator

Enumerator
kNoInplace 

do not allow inplace in arguments

kInplaceInOut 

in unary forward, allow inplace in with out

kInplaceOutIn 

in unary backward, allow inplace out_grad with in_grad

kInplaceLhsOut 

in binary forward, allow inplace left operand with out

kInplaceOutLhs 

in binary backward, allow inplace out_grad with lhs_grad

options in the registry to set symbolic registration

Enumerator
kNotRegisterSymbolic 
kRegisterSymbolic 

options in the registry to set symbolic registration

Enumerator
kScalarBeforeArray 
kArrayBeforeScalar