24 #ifndef TVM_RELAY_FUNCTION_H_ 25 #define TVM_RELAY_FUNCTION_H_ 62 v->Visit(
"params", ¶ms);
63 v->Visit(
"body", &body);
64 v->Visit(
"ret_type", &ret_type);
65 v->Visit(
"type_params", &type_params);
66 v->Visit(
"attrs", &
attrs);
67 v->Visit(
"span", &
span);
82 hash_reduce.
DefHash(type_params);
83 hash_reduce(ret_type);
96 static constexpr
const char*
_type_key =
"relay.Function";
153 #endif // TVM_RELAY_FUNCTION_H_ tvm::Span Span
Definition: base.h:65
FuncType func_type_annotation() const
Return the derived function annotation of this expression.
DictAttrs attrs
Additional attributes storing the meta-data.
Definition: function.h:80
bool DefEqual(const ObjectRef &lhs, const ObjectRef &rhs)
Reduce condition to comparison of two definitions, where free vars can be mapped. ...
Definition: structural_equal.h:165
static constexpr const char * _type_key
Definition: function.h:96
constexpr const char * kPrimitive
Mark the function as a primitive function.
Definition: function.h:127
Managed reference to FunctionNode.
Definition: function.h:104
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:102
constexpr const char * kParams
Store a Var to parameter/Constant mapping on a Function.
Definition: function.h:136
Relay expression language.
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
A Reducer class to reduce the structural hash value.
Definition: structural_hash.h:101
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
void VisitAttrs(tvm::AttrVisitor *v)
Definition: function.h:61
Managed reference to DictAttrsNode.
Definition: attrs.h:227
TVM_DECLARE_FINAL_OBJECT_INFO(FunctionNode, BaseFuncNode)
virtual void MarkGraphNode()=0
Mark current comparison as graph node equal comparison.
constexpr const char * kSkipOptimization
Mark if the function should be avoided being optimized.
Definition: function.h:140
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:52
virtual void MarkGraphNode()=0
Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure...
Type checked_type_
Stores the result of type inference(type checking).
Definition: expr.h:150
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:270
Relay Function container.
Definition: function.h:39
constexpr const char * kPartitionedFromPattern
Indicate the function was created by the Pattern Partitioning Pass.
Definition: function.h:146
Managed reference to RelayExprNode.
Definition: expr.h:177
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:706
tvm::Array< Var > params
Function parameters.
Definition: function.h:42
constexpr const char * kReshapeOnly
Mark the function as only composed of reshape operations.
Definition: function.h:148
#define TVM_DEFINE_OBJECT_REF_COW_METHOD(ObjectName)
Define CopyOnWrite function in an ObjectRef.
Definition: object.h:778
Managed reference to FuncTypeNode.
Definition: type.h:461
constexpr const char * kComposite
Treat the function as a composite operator.
Definition: function.h:142
constexpr const char * kInline
Mark the function to be inlined.
Definition: function.h:144
constexpr const char * kExternalSymbol
Store the unique external symbol for external compilers.
Definition: function.h:138
Base node of all functions.
Definition: function.h:77
constexpr const char * kCompiler
Indicate the compiler that should be used for building this function. When this is unset or set to "d...
Definition: function.h:132
Managed reference to BaseFuncNode.
Definition: function.h:143
Managed reference to TypeNode.
Definition: type.h:93
constexpr const char * kClosure
Indicate if the function is a closure.
Definition: function.h:134
tvm::Array< TypeVar > type_params
Type parameters of the function. Enables the function to vary its type based on these. This corresponds to template paramaters in c++'s terminology.
Definition: function.h:59
void SHashReduce(SHashReducer hash_reduce) const
Definition: function.h:79
Expr body
The expression which represents the computation of the function, the expression may reference the par...
Definition: function.h:49
bool SEqualReduce(const FunctionNode *other, SEqualReducer equal) const
Definition: function.h:71
Type ret_type
User annotated return type of the function.
Definition: function.h:51
void DefHash(const ObjectRef &key) const
Push hash of key to the current sequence of hash values.
Definition: structural_hash.h:178