tvm
Classes | Namespaces | Functions | Variables
function.h File Reference

Relay Function. More...

#include <tvm/ir/function.h>
#include <tvm/relay/expr.h>
#include <string>
Include dependency graph for function.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tvm::relay::FunctionNode
 Relay Function container. More...
 
class  tvm::relay::Function
 Managed reference to FunctionNode. More...
 

Namespaces

 tvm
 runtime implementation for LibTorch/TorchScript.
 
 tvm::relay
 Relay: a high level functional IR for TVM.
 
 tvm::relay::attr
 namespace of the attributes that can be attached to a relay::Function.
 

Functions

Function tvm::relay::WithFields (Function function, Optional< Array< Var >> opt_params=Optional< Array< Var >>(), Optional< Expr > opt_body=Optional< Expr >(), Optional< Type > opt_ret_type=Optional< Type >(), Optional< Array< TypeVar >> opt_ty_params=Optional< Array< TypeVar >>(), Optional< DictAttrs > opt_attrs=Optional< DictAttrs >(), Optional< VirtualDevice > opt_virtual_device=Optional< VirtualDevice >(), Optional< Span > opt_span=Optional< Span >())
 Returns function with the given properties. A null property denotes 'no change'. Returns function if all properties are unchanged. Otherwise, returns a copy with the new fields. More...
 
const FunctionNode * tvm::relay::AsOptimizableFunctionNode (const BaseFunc &base_func)
 

Variables

constexpr const char * tvm::relay::attr::kPrimitive = "Primitive"
 Mark the function as representing a sub-graph which is to be lowered or compiled as a unit. For example, the function may represent a kernel which TVM will lower to a PrimFunc. If present should be bound to Integer(1). May be accompanied by "Compiler", see below. The function body should be considered opaque by Relay, and many passes simply ignore these functions. More...
 
constexpr const char * tvm::relay::attr::kExtern = "Extern"
 Mark the function as externally implemented, ie bound in a runtime::Module within the IRModule's "external_mods" attribute. If present should be bound to Integer(1). Generally the only attribute when present. More...
 
constexpr const char * tvm::relay::attr::kCompiler = "Compiler"
 Indicates the name of the external codegen 'compiler' that should be used to lower or compile the function other than TVM's default lowering pipeline. The name may correspond to a TargetKind name. There may be a global function registered under 'relay.ext.{name}'. More...
 
constexpr const char * tvm::relay::attr::kClosure = "Closure"
 Indicate if the function is a closure. More...
 
constexpr const char * tvm::relay::attr::kParams = "__params__"
 Store a Var to parameter/Constant mapping on a Function. More...
 
constexpr const char * tvm::relay::attr::kSkipOptimization = "SkipOptimization"
 Mark if the function should be avoided being optimized. More...
 
constexpr const char * tvm::relay::attr::kComposite = "Composite"
 Treat the function as a composite operator. More...
 
constexpr const char * tvm::relay::attr::kInline = "Inline"
 Mark the function to be inlined. More...
 
constexpr const char * tvm::relay::attr::kPartitionedFromPattern = "PartitionedFromPattern"
 Indicate the function was created by the Pattern Partitioning Pass. More...
 
constexpr const char * tvm::relay::attr::kReshapeOnly = "relay.reshape_only"
 Mark the function as only composed of reshape operations. More...
 

Detailed Description

Relay Function.