mxnet
Namespaces | Classes | Enumerations | Functions
mxnet::runtime Namespace Reference

Namespaces

 detail
 

Classes

class  ADT
 reference to algebraic data type objects. More...
 
class  ADTBuilder
 A builder class that helps to incrementally build ADT. More...
 
class  ADTObj
 An object representing a structure or enumeration. More...
 
struct  array_type_info
 The type trait indicates subclass of TVM's NDArray. For irrelavant classes, code = -1. For TVM NDArray itself, code = 0. All subclasses of NDArray should override code > 0. More...
 
class  EllipsisObj
 Ellipsis. More...
 
struct  extension_type_info
 Type traits to mark if a class is tvm extension type. More...
 
class  InplaceArrayBase
 Base template for classes with array like memory layout. More...
 
class  Integer
 
class  IntegerObj
 
class  MXNetArgs
 Arguments into TVM functions. More...
 
class  MXNetArgsSetter
 
class  MXNetArgValue
 A single argument value to PackedFunc. Containing both type_code and MXNetValue. More...
 
class  MXNetDataType
 Runtime primitive data type. More...
 
class  MXNetPODValue_
 Internal base class to handle conversion to POD values. More...
 
class  MXNetRetValue
 Return Value container, Unlike MXNetArgValue, which only holds reference and do not delete the underlying container during destruction. More...
 
class  ObjAllocatorBase
 Base class of object allocators that implements make. Use curiously recurring template pattern. More...
 
class  Object
 base class of all object containers. More...
 
struct  ObjectEqual
 ObjectRef equal functor. More...
 
struct  ObjectHash
 ObjectRef hash functor. More...
 
class  ObjectPtr
 A custom smart pointer for Object. More...
 
class  ObjectRef
 Base class of all object reference. More...
 
class  PackedFunc
 Packed function is a type-erased function. The arguments are passed by packed format. More...
 
class  Registry
 Registry for global function. More...
 
class  SimpleObjAllocator
 
class  Slice
 
class  SliceObj
 Slice. More...
 
class  TypedPackedFunc
 Please refer to TypedPackedFunc<R(Args..)>. More...
 
class  TypedPackedFunc< R(Args...)>
 A PackedFunc wrapper to provide typed function signature. It is backed by a PackedFunc internally. More...
 

Enumerations

enum  TypeIndex {
  kRoot = 0, kMXNetTensor = 1, kMXNetClosure = 2, kMXNetADT = 3,
  kRuntimeModule = 4, kEllipsis = 5, kSlice = 6, kInteger = 7,
  kStaticIndexEnd, kDynamic = kStaticIndexEnd
}
 list of the type index. More...
 

Functions

ObjectRef CreateEllipsis ()
 
int64_t SliceNoneValue ()
 
template<typename T , typename... Args>
ObjectPtr< T > make_object (Args &&...args)
 Allocate an object using default allocator. More...
 
template<typename ArrayType , typename ElemType , typename... Args>
ObjectPtr< ArrayType > make_inplace_array_object (size_t num_elems, Args &&...args)
 
template<typename RefType , typename ObjectType >
RefType GetRef (const ObjectType *ptr)
 Get a reference type from a raw object ptr type. More...
 
template<typename SubRef , typename BaseRef >
SubRef Downcast (BaseRef ref)
 Downcast a base reference type to a more specific type. More...
 
template<typename BaseType , typename ObjectType >
ObjectPtr< BaseType > GetObjectPtr (ObjectType *ptr)
 Get an object ptr type from a raw object ptr. More...
 
template<typename RefType , typename ObjType >
RefType GetRef (const ObjType *ptr)
 
template<typename BaseType , typename ObjType >
ObjectPtr< BaseType > GetObjectPtr (ObjType *ptr)
 
DLDataType String2DLDataType (std::string s)
 convert a string to TVM type. More...
 
const char * TypeCode2Str (int type_code)
 Convert type code to its name. More...
 
int String2MXNetTypeWithBool (const std::string &s)
 
int String2MXNetType (const std::string &s)
 
std::ostream & operator<< (std::ostream &os, DLDataType t)
 
std::ostream & operator<< (std::ostream &os, const MXNetDataType &dtype)
 

Enumeration Type Documentation

list of the type index.

Enumerator
kRoot 

Root object type.

kMXNetTensor 
kMXNetClosure 
kMXNetADT 
kRuntimeModule 
kEllipsis 
kSlice 
kInteger 
kStaticIndexEnd 
kDynamic 

Type index is allocated during runtime.

Function Documentation

ObjectRef mxnet::runtime::CreateEllipsis ( )
inline
template<typename SubRef , typename BaseRef >
SubRef mxnet::runtime::Downcast ( BaseRef  ref)
inline

Downcast a base reference type to a more specific type.

Parameters
refThe inptut reference
Returns
The corresponding SubRef.
Template Parameters
SubRefThe target specific reference type.
BaseRefthe current reference type.
template<typename BaseType , typename ObjectType >
ObjectPtr<BaseType> mxnet::runtime::GetObjectPtr ( ObjectType *  ptr)
inline

Get an object ptr type from a raw object ptr.

Parameters
ptrThe object pointer
Template Parameters
BaseTypeThe reference type
ObjectTypeThe object type
Returns
The corresponding RefType
template<typename BaseType , typename ObjType >
ObjectPtr<BaseType> mxnet::runtime::GetObjectPtr ( ObjType *  ptr)
inline
template<typename RefType , typename ObjectType >
RefType mxnet::runtime::GetRef ( const ObjectType *  ptr)
inline

Get a reference type from a raw object ptr type.

It is always important to get a reference type if we want to return a value as reference or keep the object alive beyond the scope of the function.

Parameters
ptrThe object pointer
Template Parameters
RefTypeThe reference type
ObjectTypeThe object type
Returns
The corresponding RefType
template<typename RefType , typename ObjType >
RefType mxnet::runtime::GetRef ( const ObjType *  ptr)
inline
template<typename ArrayType , typename ElemType , typename... Args>
ObjectPtr<ArrayType> mxnet::runtime::make_inplace_array_object ( size_t  num_elems,
Args &&...  args 
)
inline
template<typename T , typename... Args>
ObjectPtr< T > mxnet::runtime::make_object ( Args &&...  args)
inline

Allocate an object using default allocator.

Parameters
argsarguments to the constructor.
Template Parameters
Tthe node type.
Returns
The ObjectPtr to the allocated object.
std::ostream& mxnet::runtime::operator<< ( std::ostream &  os,
DLDataType  t 
)
inline
std::ostream& mxnet::runtime::operator<< ( std::ostream &  os,
const MXNetDataType dtype 
)
inline
int64_t mxnet::runtime::SliceNoneValue ( )
inline
DLDataType mxnet::runtime::String2DLDataType ( std::string  s)
inline

convert a string to TVM type.

Parameters
sThe string to be converted.
Returns
The corresponding tvm type.
int mxnet::runtime::String2MXNetType ( const std::string &  s)
inline
int mxnet::runtime::String2MXNetTypeWithBool ( const std::string &  s)
inline
const char * mxnet::runtime::TypeCode2Str ( int  type_code)
inline

Convert type code to its name.

Parameters
type_codeThe type code .
Returns
The name of type code.