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