tvm
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
tvm::OpAttrMap< ValueType > Class Template Reference

Typed live view of an Op attribute column. More...

#include <op.h>

Collaboration diagram for tvm::OpAttrMap< ValueType >:

Public Member Functions

int count (const Op &op) const
 Check whether an operator has a value in this column.
 
ValueType operator[] (const Op &op) const
 Look up an operator's attribute, raising InternalError if absent.
 
ValueType get (const Op &op, ValueType def_value) const
 Look up an operator's attribute with a fallback.
 
ValueType get (const Expr &expr, ValueType def_value) const
 Look up an expression's attribute with a fallback.
 

Friends

class Op
 

Detailed Description

template<typename ValueType>
class tvm::OpAttrMap< ValueType >

Typed live view of an Op attribute column.

Copies share the retained mutable column and observe later registrations, replacements, resets, and growth. Values are returned by value, never as references into a backing array. Registration is not synchronized with readers.

Template Parameters
ValueTypeThe attribute value type.

Member Function Documentation

◆ count()

template<typename ValueType >
int tvm::OpAttrMap< ValueType >::count ( const Op &  op) const
inline

Check whether an operator has a value in this column.

Parameters
opThe operator.
Returns
1 if present, 0 otherwise.

◆ get() [1/2]

template<typename ValueType >
ValueType tvm::OpAttrMap< ValueType >::get ( const Expr &  expr,
ValueType  def_value 
) const
inline

Look up an expression's attribute with a fallback.

Parameters
exprA defined expression.
def_valueFallback when expr is not an Op or its attribute is absent.
Returns
The registered value or def_value.

◆ get() [2/2]

template<typename ValueType >
ValueType tvm::OpAttrMap< ValueType >::get ( const Op &  op,
ValueType  def_value 
) const
inline

Look up an operator's attribute with a fallback.

Parameters
opThe operator.
def_valueFallback when the attribute is absent.
Returns
The registered value or def_value.

◆ operator[]()

template<typename ValueType >
ValueType tvm::OpAttrMap< ValueType >::operator[] ( const Op &  op) const
inline

Look up an operator's attribute, raising InternalError if absent.

Parameters
opThe operator.
Returns
The value converted to ValueType.

Friends And Related Symbol Documentation

◆ Op

template<typename ValueType >
friend class Op
friend

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