tvm
Classes | Namespaces | Functions
interpreter.h File Reference

An interpreter for Relay. More...

#include <tvm/ir/module.h>
#include <tvm/relay/expr.h>
#include <tvm/runtime/container/closure.h>
#include <tvm/runtime/object.h>
#include <tvm/target/target.h>
#include <unordered_set>
Include dependency graph for interpreter.h:

Go to the source code of this file.

Classes

class  tvm::relay::InterpreterClosureObj
 The container type of Closures used by the interpreter. More...
 
class  tvm::relay::InterpreterClosure
 
class  tvm::relay::RecClosureObj
 The container type of RecClosure. More...
 
class  tvm::relay::RecClosure
 
struct  tvm::relay::RefValueObj
 
class  tvm::relay::RefValue
 
struct  tvm::relay::ConstructorValueObj
 
class  tvm::relay::ConstructorValue
 

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::relay
 Relay: a high level functional IR for TVM.
 

Functions

TypedPackedFunc< ObjectRef(Array< Expr >)> tvm::relay::EvalFunction (IRModule mod, Expr expr, Device device, Target target)
 Returns a packed function over Relay expressions which will evaluate expr applied to those arguments, where expr is w.r.t. the definitions in mod. More...
 
ObjectRef tvm::relay::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. More...
 

Detailed Description

An interpreter for Relay.

This file implements a simple reference interpreter for Relay programs. Given a Relay module, and a Relay expression it produces a value.

The interpreter's values are a naive representation of the values that can be produced by a Relay program and are exposed via TVM's object protocol to Python for introspection and debugging.

The interpreter's intent is to serve as a reference semantics for the Relay IR, as well as for debugging and testing.