tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
tvm::IRModule Class Reference

Managed reference class to IRModuleNode. More...

#include <module.h>

Inheritance diagram for tvm::IRModule:
Collaboration diagram for tvm::IRModule:

Public Types

using ContainerType = IRModuleNode
 Declare the container type. More...
 
- Public Types inherited from tvm::runtime::ObjectRef
using ContainerType = Object
 type indicate the container type. More...
 

Public Member Functions

 IRModule (Map< GlobalVar, BaseFunc > functions, SourceMap map={}, DictAttrs attrs=DictAttrs(), Map< String, Array< GlobalInfo >> global_infos={})
 constructor More...
 
 IRModule ()
 default constructor More...
 
 IRModule (ObjectPtr< Object > n)
 constructor More...
 
IRModuleNodeoperator-> () const
 
IRModule ShallowCopyIRModule (IRModule mod)
 Create a shallow copy of an IRModule. More...
 
 TVM_DEFINE_OBJECT_REF_COW_METHOD (IRModuleNode)
 
- Public Member Functions inherited from tvm::runtime::ObjectRef
 ObjectRef ()=default
 default constructor More...
 
 ObjectRef (ObjectPtr< Object > data)
 Constructor from existing object ptr. More...
 
bool same_as (const ObjectRef &other) const
 Comparator. More...
 
bool operator== (const ObjectRef &other) const
 Comparator. More...
 
bool operator!= (const ObjectRef &other) const
 Comparator. More...
 
bool operator< (const ObjectRef &other) const
 Comparator. More...
 
bool defined () const
 
const Objectget () const
 
const Objectoperator-> () const
 
bool unique () const
 
int use_count () const
 
template<typename ObjectType , typename = std::enable_if_t<std::is_base_of_v<Object, ObjectType>>>
const ObjectType * as () const
 Try to downcast the internal Object to a raw pointer of a corresponding type. More...
 
template<typename ObjectRefType , typename = std::enable_if_t<std::is_base_of_v<ObjectRef, ObjectRefType>>>
Optional< ObjectRefType > as () const
 Try to downcast the ObjectRef to a Optional<T> of the requested type. More...
 

Static Public Member Functions

static IRModule FromExpr (const RelaxExpr &expr, const Map< GlobalVar, BaseFunc > &global_funcs={})
 As for FromExprInContext, but assuming expr is bound to 'main' and no imports. More...
 

Static Public Attributes

static constexpr bool _type_is_nullable = false
 Declare whether Ref is nullable. More...
 
- Static Public Attributes inherited from tvm::runtime::ObjectRef
static constexpr bool _type_is_nullable = true
 

Additional Inherited Members

- Protected Member Functions inherited from tvm::runtime::ObjectRef
Objectget_mutable () const
 
- Static Protected Member Functions inherited from tvm::runtime::ObjectRef
template<typename T >
static T DowncastNoCheck (ObjectRef ref)
 Internal helper function downcast a ref without check. More...
 
static void FFIClearAfterMove (ObjectRef *ref)
 Clear the object ref data field without DecRef after we successfully moved the field. More...
 
template<typename ObjectType >
static ObjectPtr< ObjectType > GetDataPtr (const ObjectRef &ref)
 Internal helper function get data_ as ObjectPtr of ObjectType. More...
 
- Protected Attributes inherited from tvm::runtime::ObjectRef
ObjectPtr< Objectdata_
 Internal pointer that backs the reference. More...
 

Detailed Description

Managed reference class to IRModuleNode.

See also
IRModuleNode

Member Typedef Documentation

◆ ContainerType

Declare the container type.

Constructor & Destructor Documentation

◆ IRModule() [1/3]

tvm::IRModule::IRModule ( Map< GlobalVar, BaseFunc functions,
SourceMap  map = {},
DictAttrs  attrs = DictAttrs(),
Map< String, Array< GlobalInfo >>  global_infos = {} 
)
explicit

constructor

Parameters
functionsFunctions in the module.
mapThe module source map.
attrsThe module meta-data attributes.
global_infosGlobal infos in the module.

◆ IRModule() [2/3]

tvm::IRModule::IRModule ( )
inline

default constructor

◆ IRModule() [3/3]

tvm::IRModule::IRModule ( ObjectPtr< Object n)
inlineexplicit

constructor

Parameters
nThe object pointer.

Member Function Documentation

◆ FromExpr()

static IRModule tvm::IRModule::FromExpr ( const RelaxExpr expr,
const Map< GlobalVar, BaseFunc > &  global_funcs = {} 
)
static

As for FromExprInContext, but assuming expr is bound to 'main' and no imports.

◆ operator->()

IRModuleNode* tvm::IRModule::operator-> ( ) const
inline
Returns
mutable pointers to the node.

◆ ShallowCopyIRModule()

IRModule tvm::IRModule::ShallowCopyIRModule ( IRModule  mod)

Create a shallow copy of an IRModule.

Parameters
modThe module to copy.
Returns
The copied module.

◆ TVM_DEFINE_OBJECT_REF_COW_METHOD()

tvm::IRModule::TVM_DEFINE_OBJECT_REF_COW_METHOD ( IRModuleNode  )

Member Data Documentation

◆ _type_is_nullable

constexpr bool tvm::IRModule::_type_is_nullable = false
staticconstexpr

Declare whether Ref is nullable.


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