tvm
Public Member Functions | Static Public Member Functions | List of all members
tvm::relax::FuncStructInfo Class Reference

Managed reference to FuncStructInfoNode. More...

#include <struct_info.h>

Inheritance diagram for tvm::relax::FuncStructInfo:
Collaboration diagram for tvm::relax::FuncStructInfo:

Public Member Functions

 FuncStructInfo (Array< StructInfo > params, StructInfo ret, bool purity=true, Span span=Span())
 Constructor from parameter struct info and return value struct info. More...
 
 TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS (FuncStructInfo, StructInfo, FuncStructInfoNode)
 
- Public Member Functions inherited from tvm::relax::StructInfo
 TVM_DEFINE_OBJECT_REF_METHODS (StructInfo, ObjectRef, StructInfoNode)
 
- 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 FuncStructInfo OpaqueFunc (StructInfoDeriveFunc derive_func, bool purity=false, Span span=Span())
 Constructing an opaque function struct info using derive_func. More...
 
static FuncStructInfo OpaqueFunc (StructInfo ret=ObjectStructInfo(), bool purity=false, Span span=Span())
 Construct an opaque function using from return struct info. More...
 

Additional Inherited Members

- Public Types inherited from tvm::runtime::ObjectRef
using ContainerType = Object
 type indicate the container type. More...
 
- Static Public Attributes inherited from tvm::runtime::ObjectRef
static constexpr bool _type_is_nullable = true
 
- 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 to FuncStructInfoNode.

See also
FuncStructInfoNode

Constructor & Destructor Documentation

◆ FuncStructInfo()

tvm::relax::FuncStructInfo::FuncStructInfo ( Array< StructInfo params,
StructInfo  ret,
bool  purity = true,
Span  span = Span() 
)

Constructor from parameter struct info and return value struct info.

Parameters
paramsThe struct info of function parameters.
retThe return value struct info.
purityThe purity of the function (true by default).
spanThe span of the AST.
Note
If the ret contains variables(tir::Var and relax::Var), they must be deducible from params. If you are unsure, you can always erase ret to static.

Member Function Documentation

◆ OpaqueFunc() [1/2]

static FuncStructInfo tvm::relax::FuncStructInfo::OpaqueFunc ( StructInfo  ret = ObjectStructInfo(),
bool  purity = false,
Span  span = Span() 
)
static

Construct an opaque function using from return struct info.

Parameters
retThe struct info of the return value.
purityThe purity of the function (false by default: most external functions are not pure).
spanThe span of the AST.
Returns
The FuncStructInfo for opaque packedfunc.
Note
Defaults to an derive func that always return ObjectStructInfo if not specified.

◆ OpaqueFunc() [2/2]

static FuncStructInfo tvm::relax::FuncStructInfo::OpaqueFunc ( StructInfoDeriveFunc  derive_func,
bool  purity = false,
Span  span = Span() 
)
static

Constructing an opaque function struct info using derive_func.

Parameters
derive_funcDerivation function.
purityThe purity of the function (false by default: most external functions are not pure).
spanThe span of the AST.
Returns
The FuncStructInfo for opaque packedfunc.
Note
Defaults to an derive func that always return ObjectStructInfo if not specified.

◆ TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS()

tvm::relax::FuncStructInfo::TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS ( FuncStructInfo  ,
StructInfo  ,
FuncStructInfoNode   
)

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