a named variable in TIR
More...
#include <var.h>
|
| Var (ObjectPtr< Object > n) |
|
| Var (String name_hint="v", DataType dtype=DataType::Int(32), Span span=Span()) |
| Constructor. More...
|
|
| Var (String name_hint, Type type_annotation, Span span=Span()) |
| Constructor which provides a more detailed type annotation. More...
|
|
Var | copy_with_suffix (const String &suffix) const |
| Make a new copy of var with same type, append suffix. More...
|
|
Var | copy_with_dtype (DataType dtype) const |
| Make a new copy of the variable with specified dtype. More...
|
|
const VarNode * | operator-> () const |
| Get pointer to the internal value. More...
|
|
const VarNode * | get () const |
| Get pointer to the internal value. More...
|
|
| PrimExpr (int32_t value) |
| construct from integer. More...
|
|
| PrimExpr (float value) |
| construct from float. More...
|
|
DataType | dtype () const |
|
| TVM_DEFINE_OBJECT_REF_METHODS (PrimExpr, BaseExpr, PrimExprNode) |
|
| TVM_DEFINE_OBJECT_REF_METHODS (BaseExpr, ObjectRef, BaseExprNode) |
|
| 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 Object * | get () const |
|
const Object * | operator-> () 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...
|
|
◆ ContainerType
type indicate the container type
◆ Var() [1/3]
◆ Var() [2/3]
Constructor.
- Parameters
-
name_hint | variable name |
dtype | data type |
span | The location of this object in the source code. |
◆ Var() [3/3]
Constructor which provides a more detailed type annotation.
- Parameters
-
name_hint | variable name. |
type_annotation | The type annotation. |
span | The location of this object in the source code. |
◆ copy_with_dtype()
Var tvm::tir::Var::copy_with_dtype |
( |
DataType |
dtype | ) |
const |
Make a new copy of the variable with specified dtype.
- Parameters
-
- Returns
- The new variable
◆ copy_with_suffix()
Var tvm::tir::Var::copy_with_suffix |
( |
const String & |
suffix | ) |
const |
Make a new copy of var with same type, append suffix.
- Parameters
-
suffix | The suffix to be appended. |
- Returns
- the new Var copy
◆ get()
const VarNode* tvm::tir::Var::get |
( |
| ) |
const |
|
inline |
Get pointer to the internal value.
- Returns
- the corresponding Variable.
◆ operator->()
const VarNode* tvm::tir::Var::operator-> |
( |
| ) |
const |
|
inline |
Get pointer to the internal value.
- Returns
- the corresponding Variable.
The documentation for this class was generated from the following file: