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 VarObj with TensorType. More...

#include <expr.h>

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

Public Types

using ContainerType = VarObj
 

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.
 
TensorType ty () const
 Return the tensor type carried by the ordinary variable.
 
const ffi::Array< PrimExpr > & shape () const
 Return the shape of the tensor.
 
PrimType dtype () const
 Return the primitive element type.
 
Expr data () const
 Project the physical pointer established by the definition site.
 
runtime::MemoryScope scope () const
 Return the storage scope associated with this tensor.
 
 TensorVar (ffi::ObjectPtr< VarObj > node)
 
 TensorVar (ffi::UnsafeInit tag)
 
 TVM_FFI_DEFINE_DEFAULT_COPY_MOVE_AND_ASSIGN (TensorVar)
 
- Public Member Functions inherited from tvm::Var
TVM_TIRX_DLL Var (ffi::String name, Type ty, 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< VarObj > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (Var, Expr, VarObj)
 
- 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< ExprObj > node)
 
 TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE (Expr, ffi::ObjectRef, ExprObj)
 

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 VarObj with TensorType.

TensorVar does not introduce a runtime object or a second identity. It safely widens to Var, and get() returns the underlying VarObj used by identity-sensitive maps. operator-> exposes the same VarObj, while ty() and the metadata accessors expose its immutable TensorType access contract.

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< VarObj >  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.

◆ dtype()

PrimType tvm::tirx::TensorVar::dtype ( ) const
inline

Return the primitive element type.

◆ scope()

runtime::MemoryScope tvm::tirx::TensorVar::scope ( ) const
inline

Return the storage scope associated with this tensor.

◆ shape()

const ffi::Array< PrimExpr > & tvm::tirx::TensorVar::shape ( ) const
inline

Return the shape of the tensor.

◆ TVM_FFI_DEFINE_DEFAULT_COPY_MOVE_AND_ASSIGN()

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

◆ ty()

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

Return the tensor type carried by the ordinary variable.

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: