56 mutable int32_t
tag = -1;
61 v->Visit(
"name_hint", &name_hint);
62 v->Visit(
"inputs", &inputs);
63 v->Visit(
"belong_to", &belong_to);
64 v->Visit(
"tag", &tag);
65 v->Visit(
"span", &
span);
76 hash_reduce(name_hint);
80 static constexpr
const char*
_type_key =
"relay.Constructor";
117 v->Visit(
"header", &header);
118 v->Visit(
"type_vars", &type_vars);
119 v->Visit(
"constructors", &constructors);
120 v->Visit(
"span", &
span);
130 hash_reduce.
DefHash(type_vars);
131 hash_reduce(constructors);
134 static constexpr
const char*
_type_key =
"relay.TypeData";
163 #endif // TVM_IR_ADT_H_ bool DefEqual(const ObjectRef &lhs, const ObjectRef &rhs)
Reduce condition to comparison of two definitions, where free vars can be mapped. ...
Definitions and helper macros for IR/AST nodes.
Runtime String container types.
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:124
ADT constructor. Constructors compare by pointer equality.
Definition: adt.h:47
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:110
String name_hint
The name (only a hint)
Definition: adt.h:50
void SHashReduce(SHashReducer hash_reduce) const
Definition: adt.h:128
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
bool SEqualReduce(const ConstructorNode *other, SEqualReducer equal) const
Definition: adt.h:69
Managed reference to GlobalTypeVarNode.
Definition: type.h:332
Managed reference to ConstructorNode.
Definition: adt.h:88
Array< Type > inputs
Input to the constructor.
Definition: adt.h:52
Runtime Array container types.
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
static constexpr const char * _type_key
Definition: adt.h:80
Span span
Span that points to the original source code. Reserved debug information.
Definition: expr.h:55
IR/AST nodes for the unified type system in TVM.
Array< TypeVar > type_vars
The type variables (to allow for polymorphism).
Definition: adt.h:112
Array< Constructor > constructors
The constructors.
Definition: adt.h:114
Runtime ADT container types.
Type checked_type_
Stores the result of type inference(type checking).
Definition: expr.h:369
void VisitAttrs(AttrVisitor *v)
Definition: adt.h:116
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Type is the base type of all types.
Definition: type.h:74
TypeData container node.
Definition: adt.h:102
void VisitAttrs(AttrVisitor *v)
Definition: adt.h:60
Reference to string objects.
Definition: string.h:98
Managed reference to RelayExprNode.
Definition: expr.h:433
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:713
int32_t tag
Index in the table of constructors (set when the type is registered).
Definition: adt.h:56
TVM_DECLARE_FINAL_OBJECT_INFO(ConstructorNode, RelayExprNode)
void SHashReduce(SHashReducer hash_reduce) const
Definition: adt.h:75
tvm::Constructor Constructor
Definition: adt.h:40
ConstructorNode()
Definition: adt.h:58
GlobalTypeVar belong_to
The datatype the constructor will construct.
Definition: adt.h:54
A managed object in the TVM runtime.
GlobalTypeVar header
The header is simply the name of the ADT. We adopt nominal typing for ADT definitions; that is...
Definition: adt.h:110
bool SEqualReduce(const TypeDataNode *other, SEqualReducer equal) const
Definition: adt.h:123
Stores all data for an Algebraic Data Type (ADT).
Definition: adt.h:149
Managed reference to TypeNode.
Definition: type.h:93
tvm::TypeData TypeData
Definition: adt.h:43
Base node of all non-primitive expressions.
Definition: expr.h:361
void DefHash(const ObjectRef &key) const
Push hash of key to the current sequence of hash values.
Definition: structural_hash.h:187