tvm
Public Member Functions | Static Public Attributes | List of all members
tvm::tirx::PrimVar Class Reference

Checked scalar view over a VarNode. More...

#include <var.h>

Inheritance diagram for tvm::tirx::PrimVar:
Collaboration diagram for tvm::tirx::PrimVar:

Public Member Functions

 PrimVar (ffi::String name_hint, PrimType dtype=PrimType::Int(32), Span span=Span())
 Construct a scalar variable directly from a primitive type. More...
 
 PrimVar (ffi::String name_hint, Type type_annotation, Span span=Span())
 Construct a scalar variable directly from a checked type annotation. More...
 
 operator Var () const
 Safe widening to a general Var view over the same node. More...
 
PrimVar CopyWithSuffix (const ffi::String &suffix) const
 
PrimVar copy_with_dtype (PrimType dtype) const
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (PrimVar, PrimExpr, VarNode)
 
- Public Member Functions inherited from tvm::PrimExpr
 PrimExpr (Call call)
 Construct from a call after checking that its result type is PrimType. More...
 
 PrimExpr (int32_t value)
 construct from integer. More...
 
 PrimExpr (float value)
 construct from float. More...
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (PrimExpr, TypedExpr< PrimType >, ExprNode)
 
- Public Member Functions inherited from tvm::TypedExpr< PrimType >
PrimType ty () const
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (TypedExpr, Expr, ExprNode)
 
- Public Member Functions inherited from tvm::Expr
bool operator== (const Expr &other) const =delete
 
bool operator!= (const Expr &other) const =delete
 
bool operator< (const Expr &other) const =delete
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE (Expr, ffi::ObjectRef, ExprNode)
 

Static Public Attributes

static constexpr bool _type_container_is_exact = true
 
- Static Public Attributes inherited from tvm::PrimExpr
static constexpr bool _type_container_is_exact = false
 
- Static Public Attributes inherited from tvm::TypedExpr< PrimType >
static constexpr bool _type_container_is_exact
 

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

Checked scalar view over a VarNode.

PrimVar is a zero-state reference view over the same VarNode as Var. It additionally guarantees that the inherited ExprNode::ty is PrimType.

Constructor & Destructor Documentation

◆ PrimVar() [1/2]

tvm::tirx::PrimVar::PrimVar ( ffi::String  name_hint,
PrimType  dtype = PrimType::Int(32),
Span  span = Span() 
)
inlineexplicit

Construct a scalar variable directly from a primitive type.

◆ PrimVar() [2/2]

tvm::tirx::PrimVar::PrimVar ( ffi::String  name_hint,
Type  type_annotation,
Span  span = Span() 
)
inlineexplicit

Construct a scalar variable directly from a checked type annotation.

Member Function Documentation

◆ copy_with_dtype()

PrimVar tvm::tirx::PrimVar::copy_with_dtype ( PrimType  dtype) const
inline

◆ CopyWithSuffix()

PrimVar tvm::tirx::PrimVar::CopyWithSuffix ( const ffi::String &  suffix) const
inline

◆ operator Var()

tvm::tirx::PrimVar::operator Var ( ) const
inline

Safe widening to a general Var view over the same node.

◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE()

tvm::tirx::PrimVar::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE ( PrimVar  ,
PrimExpr  ,
VarNode   
)

Member Data Documentation

◆ _type_container_is_exact

constexpr bool tvm::tirx::PrimVar::_type_container_is_exact = true
staticconstexpr

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