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

Checked zero-state view over an ordinary VarNode with TensorType. More...

#include <expr.h>

Inheritance diagram for tvm::tirx::TensorVar:
Collaboration diagram for tvm::tirx::TensorVar:

Public Types

using ContainerType = VarNode
 

Public Member Functions

TVM_TIRX_DLL TensorVar (ffi::String name, TensorType type, Location loc=UnknownLoc())
 Construct a fresh tensor variable from an explicit TensorType.
 
 TensorVar (Var var)
 Create a checked tensor view over an existing ordinary Var.
 
Var var () const
 Return the ordinary variable view over the same identity.
 
TensorType type () const
 Return the tensor type carried by the ordinary variable.
 
const ffi::String & name () const
 Return the tensor's diagnostic name.
 
const Location & loc () const
 Return the source location carried by the ordinary Var.
 
Expr data () const
 Project the physical pointer established by the definition site.
 
ffi::String scope () const
 Return the storage scope associated with this tensor.
 
TVM_TIRX_DLL bool IsScalar (bool alloc_or_decl=true) const
 Return a new tensor with the allocated address.
 
PrimType ElementType () const
 
 TensorVar (ffi::ObjectPtr< VarNode > node)
 
 TensorVar (ffi::UnsafeInit tag)
 
 TVM_FFI_DEFINE_DEFAULT_COPY_MOVE_AND_ASSIGN (TensorVar)
 
const TensorTypeNode * operator-> () const
 
const VarNode * get () const
 
- Public Member Functions inherited from tvm::Var
TVM_TIRX_DLL Var (ffi::String name, ffi::Optional< Type > ty_annotation, Location loc=UnknownLoc())
 
TVM_TIRX_DLL Var CopyWithName (const ffi::String &name) const
 Return a fresh ordinary Var with the same type and a new name.
 
TVM_TIRX_DLL Var CopyWithSuffix (const ffi::String &suffix) const
 Return a fresh ordinary Var with a suffix appended to its name.
 
TVM_TIRX_DLL Var CopyWithDType (PrimType dtype) const
 Return a fresh ordinary Var with a new primitive type.
 
TVM_TIRX_DLL Var CopyWithType (Type type) const
 Return a fresh ordinary Var with a new type, retaining its metadata.
 
 Var (ffi::ObjectPtr< VarNode > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (Var, Expr, VarNode)
 
- 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_is_nullable = false
 
static constexpr bool _type_container_is_exact = false
 

Detailed Description

Checked zero-state view over an ordinary VarNode with TensorType.

TensorVar does not introduce a runtime object or a second identity. It safely widens to Var, and get() returns the underlying VarNode used by identity-sensitive maps. operator-> exposes the immutable TensorType access contract for concise compiler-side metadata access.

Member Typedef Documentation

◆ ContainerType

Constructor & Destructor Documentation

◆ TensorVar() [1/4]

TVM_TIRX_DLL tvm::tirx::TensorVar::TensorVar ( ffi::String  name,
TensorType  type,
Location  loc = UnknownLoc() 
)
explicit

Construct a fresh tensor variable from an explicit TensorType.

◆ TensorVar() [2/4]

tvm::tirx::TensorVar::TensorVar ( Var  var)
inlineexplicit

Create a checked tensor view over an existing ordinary Var.

◆ TensorVar() [3/4]

tvm::tirx::TensorVar::TensorVar ( ffi::ObjectPtr< VarNode >  node)
inlineexplicit

◆ TensorVar() [4/4]

tvm::tirx::TensorVar::TensorVar ( ffi::UnsafeInit  tag)
inlineexplicit

Member Function Documentation

◆ data()

Expr tvm::tirx::TensorVar::data ( ) const
inline

Project the physical pointer established by the definition site.

◆ ElementType()

PrimType tvm::tirx::TensorVar::ElementType ( ) const
inline
Returns
primitive element type for compiler-side uses.

◆ get()

const VarNode * tvm::tirx::TensorVar::get ( ) const
inline

◆ IsScalar()

TVM_TIRX_DLL bool tvm::tirx::TensorVar::IsScalar ( bool  alloc_or_decl = true) const

Return a new tensor with the allocated address.

Return true if the tensor is a scalar.

Parameters
alloc_or_declWhether to consider alloc_scalar and decl_scalar as scalar. True for alloc_scalar, False for decl_scalar.

◆ loc()

const Location & tvm::tirx::TensorVar::loc ( ) const
inline

Return the source location carried by the ordinary Var.

◆ name()

const ffi::String & tvm::tirx::TensorVar::name ( ) const
inline

Return the tensor's diagnostic name.

◆ operator->()

const TensorTypeNode * tvm::tirx::TensorVar::operator-> ( ) const
inline

◆ scope()

ffi::String tvm::tirx::TensorVar::scope ( ) const
inline

Return the storage scope associated with this tensor.

◆ TVM_FFI_DEFINE_DEFAULT_COPY_MOVE_AND_ASSIGN()

tvm::tirx::TensorVar::TVM_FFI_DEFINE_DEFAULT_COPY_MOVE_AND_ASSIGN ( TensorVar  )

◆ type()

TensorType tvm::tirx::TensorVar::type ( ) const
inline

Return the tensor type carried by the ordinary variable.

◆ var()

Var tvm::tirx::TensorVar::var ( ) const
inline

Return the ordinary variable view over the same identity.

Member Data Documentation

◆ _type_container_is_exact

constexpr bool tvm::tirx::TensorVar::_type_container_is_exact = false
staticconstexpr

◆ _type_is_nullable

constexpr bool tvm::tirx::TensorVar::_type_is_nullable = false
staticconstexpr

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