tvm
Public Member Functions | Static Public Member Functions | List of all members
tvm::runtime::Module Class Reference

Module container of TVM. More...

#include <module.h>

Collaboration diagram for tvm::runtime::Module:
Collaboration graph

Public Member Functions

 Module ()
 
 Module (std::shared_ptr< ModuleNode > n)
 
PackedFunc GetFunction (const std::string &name, bool query_imports=false)
 Get packed function from current module by name. More...
 
ModuleNodeoperator-> ()
 
const ModuleNodeoperator-> () const
 
void Import (Module other)
 Import another module into this module. More...
 

Static Public Member Functions

static Module LoadFromFile (const std::string &file_name, const std::string &format="")
 Load a module from file. More...
 

Detailed Description

Module container of TVM.

Constructor & Destructor Documentation

tvm::runtime::Module::Module ( )
inline
tvm::runtime::Module::Module ( std::shared_ptr< ModuleNode n)
inlineexplicit

Member Function Documentation

PackedFunc tvm::runtime::Module::GetFunction ( const std::string &  name,
bool  query_imports = false 
)
inline

Get packed function from current module by name.

Parameters
nameThe name of the function.
query_importsWhether also query dependency modules.
Returns
The result function. This function will return PackedFunc(nullptr) if function do not exist.
Note
Implemented in packed_func.cc
void tvm::runtime::Module::Import ( Module  other)

Import another module into this module.

Parameters
otherThe module to be imported.
Note
Cyclic dependency is not allowed among modules, An error will be thrown when cyclic dependency is detected.
static Module tvm::runtime::Module::LoadFromFile ( const std::string &  file_name,
const std::string &  format = "" 
)
static

Load a module from file.

Parameters
file_nameThe name of the host function module.
formatThe format of the file.
Note
This function won't load the import relationship. Re-create import relationship by calling Import.
ModuleNode * tvm::runtime::Module::operator-> ( )
inline
Returns
internal container
const ModuleNode * tvm::runtime::Module::operator-> ( ) const
inline
Returns
internal container

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