34 #ifndef TVM_RELAY_INTERPRETER_H_ 35 #define TVM_RELAY_INTERPRETER_H_ 43 #include <unordered_set> 66 v->Visit(
"env", &env);
67 v->Visit(
"func", &func);
70 static constexpr
const char*
_type_key =
"interpreter.Closure";
91 v->Visit(
"clos", &clos);
92 v->Visit(
"bind", &bind);
95 static constexpr
const char*
_type_key =
"interpreter.RecClosure";
112 static constexpr
const char*
_type_key =
"relay.RefValue";
131 v->Visit(
"tag", &tag);
132 v->Visit(
"fields", &fields);
133 v->Visit(
"constructor", &constructor);
136 static constexpr
const char*
_type_key =
"relay.ConstructorValue";
191 std::unordered_set<String> import_set,
Device device,
Target target,
197 #endif // TVM_RELAY_INTERPRETER_H_ ObjectRef value
Definition: interpreter.h:106
TVM_DECLARE_FINAL_OBJECT_INFO(InterpreterClosureObj, runtime::ClosureObj)
int32_t tag
Definition: interpreter.h:123
Managed reference to FunctionNode.
Definition: function.h:105
RefValueObj()
Definition: interpreter.h:108
IRModule that holds the functions and type definitions.
Relay expression language.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
Constructor constructor
Optional field tracking ADT constructor.
Definition: interpreter.h:128
Var bind
variable the closure bind to.
Definition: interpreter.h:86
Definition: interpreter.h:122
TypedPackedFunc< ObjectRef(Array< Expr >)> EvalFunction(IRModule mod, Expr expr, Device device, Target target)
Returns a packed function over Relay expressions which will evaluate expr applied to those arguments...
base class of all object containers.
Definition: object.h:167
tvm::Array< ObjectRef > fields
Definition: interpreter.h:125
Definition: interpreter.h:99
Runtime Closure container types.
Definition: interpreter.h:105
Managed reference to ConstructorNode.
Definition: adt.h:88
reference to closure.
Definition: closure.h:44
Definition: interpreter.h:74
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
Definition: interpreter.h:140
void VisitAttrs(tvm::AttrVisitor *v)
Definition: interpreter.h:65
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
InterpreterClosureObj()
Definition: interpreter.h:63
The container type of Closures used by the interpreter.
Definition: interpreter.h:49
Please refer to TypedPackedFunc<R(Args..)>.
Definition: packed_func.h:60
Definition: interpreter.h:116
Managed reference to RelayExprNode.
Definition: expr.h:433
static constexpr const char * _type_key
Definition: interpreter.h:70
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:713
void VisitAttrs(tvm::AttrVisitor *v)
Definition: interpreter.h:110
DLDevice Device
Definition: ndarray.h:43
Managed reference class to TargetNode.
Definition: target.h:183
void VisitAttrs(tvm::AttrVisitor *v)
Definition: interpreter.h:130
Base class of all object reference.
Definition: object.h:511
An object representing a closure. This object is used by both the Relay VM and interpreter.
Definition: closure.h:36
A managed object in the TVM runtime.
Managed reference class to IRModuleNode.
Definition: module.h:348
ObjectRef Eval(Expr expr, Map< GlobalTypeVar, TypeData > type_definitions, std::unordered_set< String > import_set, Device device, Target target, Map< String, ObjectRef > attrs={})
Evaluates expr and returns its result.
Compilation target object.
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics, which means map is mutable but copy will happen when array is referenced in more than two places.
Definition: map.h:1271
InterpreterClosure clos
The closure.
Definition: interpreter.h:84
The container type of RecClosure.
Definition: interpreter.h:81
void VisitAttrs(tvm::AttrVisitor *v)
Definition: interpreter.h:90
tvm::Map< Var, ObjectRef > env
The set of free variables in the closure.
Definition: interpreter.h:56
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:290
Function func
The function which implements the closure.
Definition: interpreter.h:61
RecClosureObj()
Definition: interpreter.h:88