tvm
Public Member Functions | Static Public Member Functions | Friends | List of all members
tvm::OpRegEntry Class Reference

Helper structure to register operators. More...

#include <op.h>

Collaboration diagram for tvm::OpRegEntry:

Public Member Functions

const Opop () const
 
OpRegEntrydescribe (const std::string &descr)
 setter function during registration Set the description of operator More...
 
OpRegEntryadd_argument (const std::string &name, const std::string &type, const std::string &description)
 Add argument information to the function. More...
 
OpRegEntryadd_type_rel (const std::string &rel_name, runtime::TypedPackedFunc< bool(const Array< Type > &, int, const Attrs &, const TypeReporter &)> type_rel_func)
 Attach the type function corresponding to the return type. More...
 
template<typename AttrsType >
OpRegEntryset_attrs_type ()
 Set the attrs type key and index to be AttrsType. More...
 
OpRegEntryset_attrs_type_key (const String &key)
 Set the attrs type key and index to be AttrsType. More...
 
OpRegEntryset_num_inputs (int32_t n)
 Set the num_inputs. More...
 
OpRegEntryset_support_level (int32_t level)
 Set the support level of op. More...
 
template<typename ValueType >
OpRegEntryset_attr (const std::string &attr_name, const ValueType &value, int plevel=10)
 Register additional attributes to operator. More...
 
void reset_attr (const std::string &attr_name)
 Resets an attr of the registry. More...
 
OpRegEntryset_name ()
 

Static Public Member Functions

static OpRegEntryRegisterOrGet (const String &name)
 Register or get a new entry. More...
 

Friends

template<typename , typename >
class AttrRegistry
 

Detailed Description

Helper structure to register operators.

See also
TVM_REGISTER_OP

Member Function Documentation

◆ add_argument()

OpRegEntry & tvm::OpRegEntry::add_argument ( const std::string &  name,
const std::string &  type,
const std::string &  description 
)
inline

Add argument information to the function.

Parameters
nameName of the argument.
typeType of the argument.
descriptionDescription of the argument.
Returns
reference to self.

◆ add_type_rel()

OpRegEntry & tvm::OpRegEntry::add_type_rel ( const std::string &  rel_name,
runtime::TypedPackedFunc< bool(const Array< Type > &, int, const Attrs &, const TypeReporter &)>  type_rel_func 
)
inline

Attach the type function corresponding to the return type.

Parameters
rel_nameThe type relation name to register.
type_rel_funcThe backing relation function which can solve an arbitrary relation on variables.
Returns
reference to self.

◆ describe()

OpRegEntry & tvm::OpRegEntry::describe ( const std::string &  descr)
inline

setter function during registration Set the description of operator

Parameters
descrthe description string.
Returns
reference to self.

◆ op()

const Op& tvm::OpRegEntry::op ( ) const
inline
Returns
the operator

◆ RegisterOrGet()

static OpRegEntry& tvm::OpRegEntry::RegisterOrGet ( const String name)
static

Register or get a new entry.

Parameters
nameThe name of the operator.
Returns
the corresponding entry.

◆ reset_attr()

void tvm::OpRegEntry::reset_attr ( const std::string &  attr_name)
inline

Resets an attr of the registry.

Parameters
attr_nameThe name of the attribute.

◆ set_attr()

template<typename ValueType >
OpRegEntry & tvm::OpRegEntry::set_attr ( const std::string &  attr_name,
const ValueType &  value,
int  plevel = 10 
)
inline

Register additional attributes to operator.

Parameters
attr_nameThe name of the attribute.
valueThe value to be set.
plevelThe priority level of this set, an higher priority level attribute will replace lower priority level attribute. Must be bigger than 0.

Cannot set with same plevel twice in the code.

Template Parameters
ValueTypeThe type of the value to be set.

◆ set_attrs_type()

template<typename AttrsType >
OpRegEntry & tvm::OpRegEntry::set_attrs_type
inline

Set the attrs type key and index to be AttrsType.

Template Parameters
AttrsTypethe attribute type to b set.
Returns
reference to self.

◆ set_attrs_type_key()

OpRegEntry & tvm::OpRegEntry::set_attrs_type_key ( const String key)
inline

Set the attrs type key and index to be AttrsType.

Parameters
keyThe attribute type key to be set.
Returns
reference to self.

◆ set_name()

OpRegEntry& tvm::OpRegEntry::set_name ( )
inline

◆ set_num_inputs()

OpRegEntry & tvm::OpRegEntry::set_num_inputs ( int32_t  n)
inline

Set the num_inputs.

Parameters
nThe number of inputs to be set.
Returns
reference to self.

◆ set_support_level()

OpRegEntry & tvm::OpRegEntry::set_support_level ( int32_t  level)
inline

Set the support level of op.

Parameters
levelThe support level.
Returns
reference to self.

Friends And Related Function Documentation

◆ AttrRegistry

template<typename , typename >
friend class AttrRegistry
friend

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