24 #ifndef TVM_RELAX_TYPE_H_
25 #define TVM_RELAX_TYPE_H_
39 static constexpr
int kUnknownNDim = -1;
47 v->Visit(
"ndim", &
ndim);
48 v->Visit(
"span", &
span);
57 static constexpr
const char*
_type_key =
"relax.ShapeType";
85 v->Visit(
"ndim", &
ndim);
86 v->Visit(
"dtype", &
dtype);
87 v->Visit(
"span", &
span);
103 static constexpr
const char*
_type_key =
"relax.DynTensorType";
140 static constexpr
const char*
_type_key =
"relax.ObjectType";
159 static constexpr
const char*
_type_key =
"relax.PackedFuncType";
Helpers for attribute objects.
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:135
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:121
Definition: source_map.h:120
Type is the base type of all types.
Definition: type.h:74
Span span
Span that points to the original source code. Reserved debug information.
Definition: type.h:80
Managed reference to TypeNode.
Definition: type.h:93
bool SEqualReduce(const ObjectTypeNode *other, SEqualReducer equal) const
Definition: type.h:136
void SHashReduce(SHashReducer hash_reduce) const
Definition: type.h:138
TVM_DECLARE_FINAL_OBJECT_INFO(ObjectTypeNode, TypeNode)
void VisitAttrs(tvm::AttrVisitor *v)
Definition: type.h:134
static constexpr const char * _type_key
Definition: type.h:140
ObjectType(Span span=Span())
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ObjectType, Type, ObjectTypeNode)
void SHashReduce(SHashReducer hash_reduce) const
Definition: type.h:157
bool SEqualReduce(const PackedFuncTypeNode *other, SEqualReducer equal) const
Definition: type.h:155
static constexpr const char * _type_key
Definition: type.h:159
TVM_DECLARE_FINAL_OBJECT_INFO(PackedFuncTypeNode, TypeNode)
void VisitAttrs(tvm::AttrVisitor *v)
Definition: type.h:153
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(PackedFuncType, Type, PackedFuncTypeNode)
PackedFuncType(Span span=Span())
int ndim
size of the shape.
Definition: type.h:44
void SHashReduce(SHashReducer hash_reduce) const
Definition: type.h:55
TVM_DECLARE_FINAL_OBJECT_INFO(ShapeTypeNode, TypeNode)
static constexpr const char * _type_key
Definition: type.h:57
void VisitAttrs(tvm::AttrVisitor *v)
Definition: type.h:46
bool SEqualReduce(const ShapeTypeNode *other, SEqualReducer equal) const
Definition: type.h:51
ShapeType(int ndim=kUnknownNDim, Span span=Span())
TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(ShapeType, Type, ShapeTypeNode)
Dynamic version of TensorType.
Definition: type.h:74
static constexpr const char * _type_key
Definition: type.h:103
void SHashReduce(SHashReducer hash_reduce) const
Definition: type.h:94
TVM_DECLARE_FINAL_OBJECT_INFO(TensorTypeNode, TypeNode)
bool IsUnknownDtype() const
Definition: type.h:101
bool SEqualReduce(const TensorTypeNode *other, SEqualReducer equal) const
Definition: type.h:90
void VisitAttrs(tvm::AttrVisitor *v)
Definition: type.h:84
bool IsUnknownNdim() const
Definition: type.h:99
int ndim
The number of dimensions of the tensor, use -1 to denote tensor with unknown number of dimensions.
Definition: type.h:80
DataType dtype
The content data type, use void to denote the dtype is unknown.
Definition: type.h:82
Managed reference to TensorTypeNode.
Definition: type.h:111
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:43
bool is_void() const
Definition: data_type.h:164
Serializable global function used in IR.
IR/AST nodes for the unified type system in TVM.
TensorType TensorType
Definition: type.h:130
TensorTypeNode TensorTypeNode
Definition: type.h:129
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
This file defines the TVM global function registry.