mxnet
Typedefs | Enumerations | Functions
nnvm::compiler Namespace Reference

Typedefs

using TOpPattern = int
 the operator pattern More...
 
using FTVMCompute = std::function< Array< Tensor >(const NodeAttrs &attrs, const Array< Tensor > &inputs, const Array< Tensor > &out_info)>
 Computation description interface. More...
 
using FTVMSchedule = std::function< Schedule(const NodeAttrs &attrs, const Array< Tensor > &outs, const std::string &target)>
 Build the computation schedule for op whose root is at current op. More...
 
using FTVMAlterOpLayout = std::function< bool(const NodeAttrs &attrs, const Symbol &inputs, const Array< Tensor > &tinfos, Symbol *ret)>
 Modify the op node to alter its input layout. it is invoked in AlterOpLayout pass. More...
 
using FTVMVectorizedOp = std::function< nnvm::NodePtr(const nnvm::Node *node)>
 Transform from normal operator to vectorized operator. More...
 
using AttrDict = std::unordered_map< std::string, std::string >
 

Enumerations

enum  OpPatternKind {
  kElemWise = 0, kBroadcast = 1, kInjective = 2, kCommReduce = 3,
  kOutEWiseFusable = 4, kOpaque = 8
}
 operator pattern used in graph fusion More...
 

Functions

const PackedFunc & GetPackedFunc (const std::string &name)
 Get PackedFunction from global registry and report error if it does not exist. More...
 
tvm::Array< tvm::Expr > ShapeToArray (TShape shape)
 
tvm::Array< tvm::Integer > ShapeToIntArray (TShape shape)
 

Typedef Documentation

using nnvm::compiler::AttrDict = typedef std::unordered_map<std::string, std::string>
using nnvm::compiler::FTVMAlterOpLayout = typedef std::function< bool(const NodeAttrs& attrs, const Symbol& inputs, const Array<Tensor>& tinfos, Symbol* ret)>

Modify the op node to alter its input layout. it is invoked in AlterOpLayout pass.

Parameters
attrsThe attribute of the original node.
inputsThe input symbols of the original node.
tinfosThe inferred shape and dtype of the inputs.
retThe replaced operator.
Returns
Whether to replace current operator.
using nnvm::compiler::FTVMCompute = typedef std::function< Array<Tensor>(const NodeAttrs& attrs, const Array<Tensor>& inputs, const Array<Tensor>& out_info)>

Computation description interface.

Parameters
attrsThe attribute of the node.
inputsThe input tensors(placeholders)
out_infoTensors holding shape/type information about output, & these are always placeholders.
Returns
The output description of the tensor.
using nnvm::compiler::FTVMSchedule = typedef std::function< Schedule(const NodeAttrs& attrs, const Array<Tensor>& outs, const std::string& target)>

Build the computation schedule for op whose root is at current op.

Parameters
attrsThe attribute of the node.
outsThe output tensors.
targetThe build target.
Returns
schedule The computation schedule.
using nnvm::compiler::FTVMVectorizedOp = typedef std::function<nnvm::NodePtr (const nnvm::Node* node)>

Transform from normal operator to vectorized operator.

Parameters
nodeThe source node.
Returns
Transformed vectorized op.
using nnvm::compiler::TOpPattern = typedef int

the operator pattern

Enumeration Type Documentation

operator pattern used in graph fusion

Enumerator
kElemWise 
kBroadcast 
kInjective 
kCommReduce 
kOutEWiseFusable 
kOpaque 

Function Documentation

const PackedFunc& nnvm::compiler::GetPackedFunc ( const std::string &  name)
inline

Get PackedFunction from global registry and report error if it does not exist.

Parameters
nameThe name of the function.
Returns
The created PackedFunc.
tvm::Array<tvm::Expr> nnvm::compiler::ShapeToArray ( TShape  shape)
inline
tvm::Array<tvm::Integer> nnvm::compiler::ShapeToIntArray ( TShape  shape)
inline