24 #ifndef TVM_RELAX_TYPE_H_
25 #define TVM_RELAX_TYPE_H_
27 #include <tvm/ffi/function.h>
28 #include <tvm/ffi/reflection/registry.h>
40 static constexpr
int kUnknownNDim = -1;
78 refl::ObjectDef<TensorTypeNode>()
118 refl::ObjectDef<ObjectTypeNode>();
134 refl::ObjectDef<PackedFuncTypeNode>();
Helpers for attribute objects.
Definition: source_map.h:111
Type is the base type of all types.
Definition: type.h:74
Managed reference to TypeNode.
Definition: type.h:99
static void RegisterReflection()
Definition: type.h:116
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.ObjectType", ObjectTypeNode, TypeNode)
ObjectType(Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ObjectType, Type, ObjectTypeNode)
static void RegisterReflection()
Definition: type.h:132
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.PackedFuncType", PackedFuncTypeNode, TypeNode)
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(PackedFuncType, Type, PackedFuncTypeNode)
PackedFuncType(Span span=Span())
int ndim
size of the shape.
Definition: type.h:45
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.ShapeType", ShapeTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:47
ShapeType(int ndim, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ShapeType, Type, ShapeTypeNode)
Dynamic version of TensorType.
Definition: type.h:66
bool IsUnknownDtype() const
Definition: type.h:85
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.DynTensorType", TensorTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:76
bool IsUnknownNdim() const
Definition: type.h:83
int ndim
The number of dimensions of the tensor, use -1 to denote tensor with unknown number of dimensions.
Definition: type.h:72
DataType dtype
The content data type, use void to denote the dtype is unknown.
Definition: type.h:74
Managed reference to TensorTypeNode.
Definition: type.h:93
TensorType(int ndim, DataType dtype, Span span=Span())
Constructor.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(TensorType, Type, TensorTypeNode)
static TensorType CreateUnknownNDim(DataType dtype, Span span=Span())
Create a TensorType with unknown ndim.
Runtime primitive data type.
Definition: data_type.h:47
bool is_void() const
Definition: data_type.h:213
Serializable global function used in IR.
IR/AST nodes for the unified type system in TVM.
Definition: repr_printer.h:91
TensorType TensorType
Definition: type.h:112
TensorTypeNode TensorTypeNode
Definition: type.h:111
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37