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;
52 static constexpr
const char*
_type_key =
"relax.ShapeType";
81 refl::ObjectDef<TensorTypeNode>()
90 static constexpr
const char*
_type_key =
"relax.DynTensorType";
123 refl::ObjectDef<ObjectTypeNode>();
126 static constexpr
const char*
_type_key =
"relax.ObjectType";
141 refl::ObjectDef<PackedFuncTypeNode>();
144 static constexpr
const char*
_type_key =
"relax.PackedFuncType";
Helpers for attribute objects.
Definition: source_map.h:113
Type is the base type of all types.
Definition: type.h:75
Managed reference to TypeNode.
Definition: type.h:101
TVM_DECLARE_FINAL_OBJECT_INFO(ObjectTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:121
static constexpr const char * _type_key
Definition: type.h:126
ObjectType(Span span=Span())
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ObjectType, Type, ObjectTypeNode)
static constexpr const char * _type_key
Definition: type.h:144
TVM_DECLARE_FINAL_OBJECT_INFO(PackedFuncTypeNode, TypeNode)
static void RegisterReflection()
Definition: type.h:139
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(PackedFuncType, Type, PackedFuncTypeNode)
PackedFuncType(Span span=Span())
int ndim
size of the shape.
Definition: type.h:45
TVM_DECLARE_FINAL_OBJECT_INFO(ShapeTypeNode, TypeNode)
static constexpr const char * _type_key
Definition: type.h:52
static void RegisterReflection()
Definition: type.h:47
ShapeType(int ndim=kUnknownNDim, Span span=Span())
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ShapeType, Type, ShapeTypeNode)
Dynamic version of TensorType.
Definition: type.h:69
static constexpr const char * _type_key
Definition: type.h:90
TVM_DECLARE_FINAL_OBJECT_INFO(TensorTypeNode, TypeNode)
bool IsUnknownDtype() const
Definition: type.h:88
static void RegisterReflection()
Definition: type.h:79
bool IsUnknownNdim() const
Definition: type.h:86
int ndim
The number of dimensions of the tensor, use -1 to denote tensor with unknown number of dimensions.
Definition: type.h:75
DataType dtype
The content data type, use void to denote the dtype is unknown.
Definition: type.h:77
Managed reference to TensorTypeNode.
Definition: type.h:98
TensorType(int ndim, DataType dtype, Span span=Span())
Constructor.
TVM_DEFINE_OBJECT_REF_METHODS(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:117
TensorTypeNode TensorTypeNode
Definition: type.h:116
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37