24 #ifndef TVM_RELAY_ANALYSIS_H_
25 #define TVM_RELAY_ANALYSIS_H_
32 #include <tvm/runtime/logging.h>
35 #include <unordered_map>
Managed reference class to IRModuleNode.
Definition: module.h:366
Managed reference to RelayExprNode.
Definition: expr.h:442
Managed reference to TypeNode.
Definition: type.h:93
Pattern is the base type for an ADT match pattern in Relay.
Definition: adt.h:63
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Map container of NodeRef->NodeRef in DSL graph. Map implements copy on write semantics,...
Definition: map.h:1271
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
IRModule that holds the functions and type definitions.
tvm::Array< Var > BoundVars(const Expr &expr)
Get all bound variables from expression expr.
Map< GlobalVar, Array< Integer > > GetCalibrateOutputMap(const IRModule &mod)
Get the output map between subgrpahs and its inputs/output.
tvm::Array< TypeVar > BoundTypeVars(const Expr &expr, const IRModule &mod)
Get all bound type variables from expression expr.
std::unordered_map< const Object *, size_t > GetExprRefCount(const Expr &body)
Get reference counter of each internal ExprNode in body.
bool WellFormed(const Expr &expr, Optional< DiagnosticContext > diag_ctx=Optional< DiagnosticContext >())
Check that each Var is only bound once.
tvm::Array< Var > AllVars(const Expr &expr)
Get all variables from expression expr.
Kind KindCheck(const Type &t, const IRModule &mod, Optional< DiagnosticContext > diag_ctx=Optional< DiagnosticContext >())
Check that types are well kinded by applying "kinding rules".
Array< Pattern > UnmatchedCases(const Match &match, const IRModule &mod)
Finds cases that the given match expression does not catch, if any.
bool ConstantCheck(const Expr &e)
Check whether an expression is constant.
tvm::Array< TypeVar > FreeTypeVars(const Expr &expr, const IRModule &mod)
Get free TypeVars from expression expr.
bool BasicBlockNormalFormCheck(const Expr &e)
Check whether an expression is in the basic block normal form.
tvm::Array< TypeVar > AllTypeVars(const Expr &expr, const IRModule &mod)
Get all type variables in expression expr.
IRModule GetCalibrateModule(IRModule mod)
Get the updated module for collecting calibration data.
tvm::Array< Var > FreeVars(const Expr &expr)
Get free type parameters from expression expr.
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:290
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
TypeKind
Possible kinds of TypeVars.
Definition: type.h:201
Algebraic data types for Relay.
Relay expression language.