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;
79 refl::ObjectDef<TensorTypeNode>()
119 refl::ObjectDef<ObjectTypeNode>();
135 refl::ObjectDef<PackedFuncTypeNode>();
Helpers for attribute objects.
Definition: source_map.h:111
Type is the base type of all types.
Definition: type.h:75
Managed reference to TypeNode.
Definition: type.h:100
static void RegisterReflection()
Definition: type.h:117
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:133
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=kUnknownNDim, Span span=Span())
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ShapeType, Type, ShapeTypeNode)
Dynamic version of TensorType.
Definition: type.h:67
bool IsUnknownDtype() const
Definition: type.h:86
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("relax.DynTensorType", TensorTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:77
bool IsUnknownNdim() const
Definition: type.h:84
int ndim
The number of dimensions of the tensor, use -1 to denote tensor with unknown number of dimensions.
Definition: type.h:73
DataType dtype
The content data type, use void to denote the dtype is unknown.
Definition: type.h:75
Managed reference to TensorTypeNode.
Definition: type.h:94
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:209
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:113
TensorTypeNode TensorTypeNode
Definition: type.h:112
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37