Class TensorVar#
Defined in File expr.h
Inheritance Relationships#
Base Type#
public tvm::Var(Class Var)
Class Documentation#
-
class TensorVar : public tvm::Var#
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.
Public Functions
-
explicit TensorVar(ffi::String name, TensorType type, Location loc = UnknownLoc())#
Construct a fresh tensor variable from an explicit TensorType.
-
inline TensorType ty() const#
Return the tensor type carried by the ordinary variable.
-
inline runtime::MemoryScope scope() const#
Return the storage scope associated with this tensor.
-
bool IsScalar(bool alloc_or_decl = true) const#
Return true if the tensor is a scalar.
- Parameters:
alloc_or_decl – Whether to consider alloc_scalar and decl_scalar as scalar. True for alloc_scalar, False for decl_scalar.
-
inline explicit TensorVar(ffi::UnsafeInit tag)#
-
explicit TensorVar(ffi::String name, TensorType type, Location loc = UnknownLoc())#