tvm
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
tvm::PrimVar Class Reference

Checked scalar view over a VarNode. More...

#include <expr.h>

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

Public Member Functions

 PrimVar (ffi::String name, PrimType dtype=PrimType::Int(32), Location loc=UnknownLoc())
 Construct a scalar variable directly from a primitive type.
 
 PrimVar (ffi::String name, Type type_annotation, Location loc=UnknownLoc())
 Construct a scalar variable directly from a checked type annotation.
 
 operator Var () const
 Safe widening to a general Var view over the same node.
 
PrimVar CopyWithSuffix (const ffi::String &suffix) const
 
PrimVar CopyWithDType (PrimType dtype) const
 
 PrimVar (ffi::ObjectPtr< VarNode > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (PrimVar, PrimExpr, VarNode)
 
- Public Member Functions inherited from tvm::PrimExpr
TVM_TIRX_DLL PrimExpr (Call call)
 Construct from a call after checking that its result type is PrimType.
 
TVM_TIRX_DLL PrimExpr (int32_t value)
 construct from integer.
 
TVM_TIRX_DLL PrimExpr (float value)
 construct from float.
 
 PrimExpr (ffi::ObjectPtr< ExprNode > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (PrimExpr, TypedExpr< PrimType >, ExprNode)
 
- Public Member Functions inherited from tvm::TypedExpr< PrimType >
PrimType ty () const
 
 TypedExpr (ffi::ObjectPtr< ExprNode > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (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
 
 Expr (ffi::ObjectPtr< ExprNode > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (Expr, ffi::ObjectRef, ExprNode)
 

Static Public Attributes

static constexpr bool _type_container_is_exact = false
 
- 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
 

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/3]

tvm::PrimVar::PrimVar ( ffi::String  name,
PrimType  dtype = PrimType::Int(32),
Location  loc = UnknownLoc() 
)
inlineexplicit

Construct a scalar variable directly from a primitive type.

◆ PrimVar() [2/3]

tvm::PrimVar::PrimVar ( ffi::String  name,
Type  type_annotation,
Location  loc = UnknownLoc() 
)
inlineexplicit

Construct a scalar variable directly from a checked type annotation.

◆ PrimVar() [3/3]

tvm::PrimVar::PrimVar ( ffi::ObjectPtr< VarNode >  node)
inlineexplicit

Member Function Documentation

◆ CopyWithDType()

PrimVar tvm::PrimVar::CopyWithDType ( PrimType  dtype) const
inline

◆ CopyWithSuffix()

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

◆ operator Var()

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

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

◆ TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE()

tvm::PrimVar::TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE ( PrimVar  ,
PrimExpr  ,
VarNode   
)

Member Data Documentation

◆ _type_container_is_exact

constexpr bool tvm::PrimVar::_type_container_is_exact = false
staticconstexpr

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