24 #ifndef TVM_RELAY_BASE_H_
25 #define TVM_RELAY_BASE_H_
45 #define RELAY_DEBUG(...) \
47 auto fdebug = runtime::Registry::Get("relay.debug"); \
48 ICHECK(fdebug) << "Could not find Relay Python debugger function."; \
49 (*fdebug)("RELAY_DEBUG", __FILE__, __LINE__, __VA_ARGS__); \
52 #define RELAY_DEBUG_INTERP(...) \
54 auto fdebug = runtime::Registry::Get("relay.debug_interp"); \
55 ICHECK(fdebug) << "Could not find Relay Python debugger function."; \
56 (*fdebug)("RELAY_DEBUG", __FILE__, __LINE__, __VA_ARGS__); \
77 static constexpr
const char*
_type_key =
"relay.Node";
101 return equal.FreeVarEqualImpl(
this, other);
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
Reference to PrimExprNode.
Definition: expr.h:115
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:137
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:121
void FreeVarHashImpl(const runtime::Object *var) const
Implementation for hash for a free var.
Definition: structural_hash.h:203
The source name of a file span.
Definition: source_map.h:67
Stores locations in frontend source that generated a node.
Definition: source_map.h:87
Definition: source_map.h:120
The unique identifier of variables.
Definition: base.h:89
static constexpr const char * _type_key
Definition: base.h:106
bool SEqualReduce(const IdNode *other, SEqualReducer equal) const
Definition: base.h:100
void VisitAttrs(tvm::AttrVisitor *v)
Definition: base.h:98
static constexpr const bool _type_has_method_shash_reduce
Definition: base.h:108
TVM_DECLARE_FINAL_OBJECT_INFO(IdNode, Object)
static constexpr const bool _type_has_method_sequal_reduce
Definition: base.h:107
String name_hint
The name of the variable, this only acts as a hint to the user, and is not used for equality.
Definition: base.h:96
void SHashReduce(SHashReducer hash_reduce) const
Definition: base.h:104
Id(String name_hint)
The constructor.
TVM_DEFINE_OBJECT_REF_METHODS(Id, ObjectRef, IdNode)
This is the base node container of all relay structures.
Definition: base.h:71
static constexpr const char * _type_key
Definition: base.h:77
Span span
The location of the program in a SourceFragment can be null, check with span.defined()
Definition: base.h:75
TVM_DECLARE_BASE_OBJECT_INFO(RelayNode, Object)
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Reference to string objects.
Definition: string.h:98
Please refer to TypedPackedFunc<R(Args..)>.
Definition: packed_func.h:63
tvm::SourceName SourceName
Definition: base.h:64
String PrettyPrint(const ObjectRef &node)
Pretty print a node for debug purposes.
tvm::SpanNode SpanNode
Definition: base.h:66
tvm::Span Span
Definition: base.h:65
String AsText(const ObjectRef &node, bool show_meta_data=true, runtime::TypedPackedFunc< String(ObjectRef)> annotate=nullptr)
Render the node as a string in the text format.
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 map from source names to source code.