tvm
Public Types | Public Member Functions | List of all members
tvm::tir::Var Class Reference

a named variable in TIR More...

#include <var.h>

Inheritance diagram for tvm::tir::Var:
Collaboration diagram for tvm::tir::Var:

Public Types

using ContainerType = VarNode
 type indicate the container type More...
 

Public Member Functions

 Var (ffi::UnsafeInit tag)
 
 Var (ObjectPtr< VarNode > n)
 
 Var (ffi::String name_hint="v", DataType dtype=DataType::Int(32), Span span=Span())
 Constructor. More...
 
 Var (ffi::String name_hint, Type type_annotation, Span span=Span())
 Constructor which provides a more detailed type annotation. More...
 
Var copy_with_name (const ffi::String &name) const
 Make a new copy of var with same type, but a different nam. More...
 
Var copy_with_suffix (const ffi::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 VarNodeoperator-> () const
 Get pointer to the internal value. More...
 
const VarNodeget () const
 Get pointer to the internal value. More...
 
- Public Member Functions inherited from tvm::PrimExpr
 PrimExpr (int32_t value)
 construct from integer. More...
 
 PrimExpr (float value)
 construct from float. More...
 
DataType dtype () const
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (PrimExpr, BaseExpr, PrimExprNode)
 
- Public Member Functions inherited from tvm::BaseExpr
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (BaseExpr, ObjectRef, BaseExprNode)
 

Additional Inherited Members

- Static Public Member Functions inherited from tvm::PrimExpr
static PrimExpr ConvertFallbackValue (ffi::String value)
 construct from string to form a StringImm. More...
 

Detailed Description

a named variable in TIR

Member Typedef Documentation

◆ ContainerType

type indicate the container type

Constructor & Destructor Documentation

◆ Var() [1/4]

tvm::tir::Var::Var ( ffi::UnsafeInit  tag)
inlineexplicit

◆ Var() [2/4]

tvm::tir::Var::Var ( ObjectPtr< VarNode n)
inlineexplicit

◆ Var() [3/4]

tvm::tir::Var::Var ( ffi::String  name_hint = "v",
DataType  dtype = DataType::Int(32),
Span  span = Span() 
)
explicit

Constructor.

Parameters
name_hintvariable name
dtypedata type
spanThe location of this object in the source code.

◆ Var() [4/4]

tvm::tir::Var::Var ( ffi::String  name_hint,
Type  type_annotation,
Span  span = Span() 
)
explicit

Constructor which provides a more detailed type annotation.

Parameters
name_hintvariable name.
type_annotationThe type annotation.
spanThe location of this object in the source code.

Member Function Documentation

◆ copy_with_dtype()

Var tvm::tir::Var::copy_with_dtype ( DataType  dtype) const

Make a new copy of the variable with specified dtype.

Parameters
dtypeThe specified dtype
Returns
The new variable

◆ copy_with_name()

Var tvm::tir::Var::copy_with_name ( const ffi::String &  name) const

Make a new copy of var with same type, but a different nam.

Parameters
nameThe new name to be used.
Returns
the new Var copy

◆ copy_with_suffix()

Var tvm::tir::Var::copy_with_suffix ( const ffi::String &  suffix) const

Make a new copy of var with same type, append suffix.

Parameters
suffixThe 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: