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  Float
 
class  FloatObj
 
class  InplaceArrayBase
 Base template for classes with array like memory layout. More...
 
class  Integer
 
class  IntegerObj
 
class  Map
 Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places. More...
 
class  MapObj
 Shared content of all specializations of hash map. More...
 
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...
 
struct  ObjectRefEqual
 String-aware ObjectRef equal functor. More...
 
struct  ObjectRefHash
 String-aware ObjectRef hash functor. More...
 
struct  ObjectTypeChecker
 Type traits for runtime type check during FFI conversion. More...
 
class  PackedFunc
 Packed function is a type-erased function. The arguments are passed by packed format. More...
 
struct  PackedFuncValueConverter
 Type trait to specify special value conversion rules from MXNetArgValue and MXNetRetValue. More...
 
struct  PackedFuncValueConverter<::mxnet::runtime::String >
 
class  PythonArg
 
class  Registry
 Registry for global function. More...
 
class  SimpleObjAllocator
 
class  Slice
 
class  SliceObj
 Slice. More...
 
class  String
 Reference to string objects. More...
 
class  StringObj
 An object representing string. It's POD type. 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,
  kMXNetMap = 4, kMXNetString = 5, kEllipsis = 6, kSlice = 7,
  kInteger = 8, kFloat = 9, kStaticIndexEnd, kDynamic = kStaticIndexEnd
}
 list of the type index. More...
 

Functions

template<typename K , typename V , typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
Map< K, V > Merge (Map< K, V > lhs, const Map< K, V > &rhs)
 Merge two Maps. More...
 
String operator+ (const String &lhs, const String &rhs)
 
String operator+ (const String &lhs, const std::string &rhs)
 
String operator+ (const std::string &lhs, const String &rhs)
 
String operator+ (const char *lhs, const String &rhs)
 
String operator+ (const String &lhs, const char *rhs)
 
bool operator< (const String &lhs, const std::string &rhs)
 
bool operator< (const std::string &lhs, const String &rhs)
 
bool operator< (const String &lhs, const String &rhs)
 
bool operator< (const String &lhs, const char *rhs)
 
bool operator< (const char *lhs, const String &rhs)
 
bool operator> (const String &lhs, const std::string &rhs)
 
bool operator> (const std::string &lhs, const String &rhs)
 
bool operator> (const String &lhs, const String &rhs)
 
bool operator> (const String &lhs, const char *rhs)
 
bool operator> (const char *lhs, const String &rhs)
 
bool operator<= (const String &lhs, const std::string &rhs)
 
bool operator<= (const std::string &lhs, const String &rhs)
 
bool operator<= (const String &lhs, const String &rhs)
 
bool operator<= (const String &lhs, const char *rhs)
 
bool operator<= (const char *lhs, const String &rhs)
 
bool operator>= (const String &lhs, const std::string &rhs)
 
bool operator>= (const std::string &lhs, const String &rhs)
 
bool operator>= (const String &lhs, const String &rhs)
 
bool operator>= (const String &lhs, const char *rhs)
 
bool operator>= (const char *lhs, const String &rhs)
 
bool operator== (const String &lhs, const std::string &rhs)
 
bool operator== (const std::string &lhs, const String &rhs)
 
bool operator== (const String &lhs, const String &rhs)
 
bool operator== (const String &lhs, const char *rhs)
 
bool operator== (const char *lhs, const String &rhs)
 
bool operator!= (const String &lhs, const std::string &rhs)
 
bool operator!= (const std::string &lhs, const String &rhs)
 
bool operator!= (const String &lhs, const String &rhs)
 
bool operator!= (const String &lhs, const char *rhs)
 
bool operator!= (const char *lhs, const String &rhs)
 
std::ostream & operator<< (std::ostream &out, const String &input)
 
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

◆ TypeIndex

list of the type index.

Enumerator
kRoot 

Root object type.

kMXNetTensor 
kMXNetClosure 
kMXNetADT 
kMXNetMap 
kMXNetString 
kEllipsis 
kSlice 
kInteger 
kFloat 
kStaticIndexEnd 
kDynamic 

Type index is allocated during runtime.

Function Documentation

◆ CreateEllipsis()

ObjectRef mxnet::runtime::CreateEllipsis ( )
inline

◆ Downcast()

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.

◆ GetObjectPtr() [1/2]

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

◆ GetObjectPtr() [2/2]

template<typename BaseType , typename ObjType >
ObjectPtr<BaseType> mxnet::runtime::GetObjectPtr ( ObjType *  ptr)
inline

◆ GetRef() [1/2]

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

◆ GetRef() [2/2]

template<typename RefType , typename ObjType >
RefType mxnet::runtime::GetRef ( const ObjType *  ptr)
inline

◆ make_inplace_array_object()

template<typename ArrayType , typename ElemType , typename... Args>
ObjectPtr<ArrayType> mxnet::runtime::make_inplace_array_object ( size_t  num_elems,
Args &&...  args 
)
inline

◆ make_object()

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.

◆ Merge()

template<typename K , typename V , typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type, typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
Map<K, V> mxnet::runtime::Merge ( Map< K, V >  lhs,
const Map< K, V > &  rhs 
)
inline

Merge two Maps.

Parameters
lhsthe first Map to merge.
rhsthe second Map to merge.
Returns
The merged Array. Original Maps are kept unchanged.

◆ operator!=() [1/5]

bool mxnet::runtime::operator!= ( const char *  lhs,
const String rhs 
)
inline

◆ operator!=() [2/5]

bool mxnet::runtime::operator!= ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator!=() [3/5]

bool mxnet::runtime::operator!= ( const String lhs,
const char *  rhs 
)
inline

◆ operator!=() [4/5]

bool mxnet::runtime::operator!= ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator!=() [5/5]

bool mxnet::runtime::operator!= ( const String lhs,
const String rhs 
)
inline

◆ operator+() [1/5]

String mxnet::runtime::operator+ ( const char *  lhs,
const String rhs 
)
inline

◆ operator+() [2/5]

String mxnet::runtime::operator+ ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator+() [3/5]

String mxnet::runtime::operator+ ( const String lhs,
const char *  rhs 
)
inline

◆ operator+() [4/5]

String mxnet::runtime::operator+ ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator+() [5/5]

String mxnet::runtime::operator+ ( const String lhs,
const String rhs 
)
inline

◆ operator<() [1/5]

bool mxnet::runtime::operator< ( const char *  lhs,
const String rhs 
)
inline

◆ operator<() [2/5]

bool mxnet::runtime::operator< ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator<() [3/5]

bool mxnet::runtime::operator< ( const String lhs,
const char *  rhs 
)
inline

◆ operator<() [4/5]

bool mxnet::runtime::operator< ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator<() [5/5]

bool mxnet::runtime::operator< ( const String lhs,
const String rhs 
)
inline

◆ operator<<() [1/3]

std::ostream& mxnet::runtime::operator<< ( std::ostream &  os,
const MXNetDataType dtype 
)
inline

◆ operator<<() [2/3]

std::ostream& mxnet::runtime::operator<< ( std::ostream &  os,
DLDataType  t 
)
inline

◆ operator<<() [3/3]

std::ostream& mxnet::runtime::operator<< ( std::ostream &  out,
const String input 
)
inline

◆ operator<=() [1/5]

bool mxnet::runtime::operator<= ( const char *  lhs,
const String rhs 
)
inline

◆ operator<=() [2/5]

bool mxnet::runtime::operator<= ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator<=() [3/5]

bool mxnet::runtime::operator<= ( const String lhs,
const char *  rhs 
)
inline

◆ operator<=() [4/5]

bool mxnet::runtime::operator<= ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator<=() [5/5]

bool mxnet::runtime::operator<= ( const String lhs,
const String rhs 
)
inline

◆ operator==() [1/5]

bool mxnet::runtime::operator== ( const char *  lhs,
const String rhs 
)
inline

◆ operator==() [2/5]

bool mxnet::runtime::operator== ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator==() [3/5]

bool mxnet::runtime::operator== ( const String lhs,
const char *  rhs 
)
inline

◆ operator==() [4/5]

bool mxnet::runtime::operator== ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator==() [5/5]

bool mxnet::runtime::operator== ( const String lhs,
const String rhs 
)
inline

◆ operator>() [1/5]

bool mxnet::runtime::operator> ( const char *  lhs,
const String rhs 
)
inline

◆ operator>() [2/5]

bool mxnet::runtime::operator> ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator>() [3/5]

bool mxnet::runtime::operator> ( const String lhs,
const char *  rhs 
)
inline

◆ operator>() [4/5]

bool mxnet::runtime::operator> ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator>() [5/5]

bool mxnet::runtime::operator> ( const String lhs,
const String rhs 
)
inline

◆ operator>=() [1/5]

bool mxnet::runtime::operator>= ( const char *  lhs,
const String rhs 
)
inline

◆ operator>=() [2/5]

bool mxnet::runtime::operator>= ( const std::string &  lhs,
const String rhs 
)
inline

◆ operator>=() [3/5]

bool mxnet::runtime::operator>= ( const String lhs,
const char *  rhs 
)
inline

◆ operator>=() [4/5]

bool mxnet::runtime::operator>= ( const String lhs,
const std::string &  rhs 
)
inline

◆ operator>=() [5/5]

bool mxnet::runtime::operator>= ( const String lhs,
const String rhs 
)
inline

◆ SliceNoneValue()

int64_t mxnet::runtime::SliceNoneValue ( )
inline

◆ String2DLDataType()

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.

◆ String2MXNetType()

int mxnet::runtime::String2MXNetType ( const std::string &  s)
inline

◆ String2MXNetTypeWithBool()

int mxnet::runtime::String2MXNetTypeWithBool ( const std::string &  s)
inline

◆ TypeCode2Str()

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.