tvm
Loading...
Searching...
No Matches
Classes | Namespaces | Functions
nested_msg.h File Reference

Helper container to store nested message for robust tuple-aware analysis. More...

#include <tvm/ffi/container/array.h>
#include <tvm/ffi/optional.h>
#include <tvm/relax/expr.h>
#include <tvm/relax/type.h>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for nested_msg.h:

Go to the source code of this file.

Classes

class  tvm::relax::NestedMsg< T >
 Container that stores possibly nested message with leaf message type T. More...
 

Namespaces

namespace  tvm
 An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
 
namespace  tvm::relax
 
namespace  tvm::ffi
 

Functions

template<typename T , typename FType >
void tvm::relax::ForEachLeaf (const NestedMsg< T > &msg, FType fvisit)
 Apply fvisit for each leaf elements in the nested message.
 
template<typename T , typename FType >
bool tvm::relax::Equal (const NestedMsg< T > &lhs, const NestedMsg< T > &rhs, FType fequal)
 Recursively compare two nested messages.
 
template<typename T , typename FType >
NestedMsg< Ttvm::relax::MapToNestedMsg (Expr expr, FType fmapleaf)
 Map expr with possible nested-tuple to nested message.
 
template<typename T , typename FType >
NestedMsg< Ttvm::relax::MapToNestedMsg (Type ty, FType fmapleaf)
 Map structinfo with possible nested-ty to nested message.
 
template<typename T , typename FType >
NestedMsg< Ttvm::relax::MapToNestedMsgByType (Expr expr, FType fmapleaf)
 Map expr with possible nested-tuple to nested message.
 
template<typename TargetType , typename T , typename FMapLeaf , typename FCombine >
TargetType tvm::relax::NestedMsgTo (NestedMsg< T > msg, FMapLeaf fmapleaf, FCombine fcombine)
 Map nested message back to TargetType.
 
template<typename T , typename FType >
Expr tvm::relax::NestedMsgToExpr (NestedMsg< T > msg, FType fmapleaf)
 Map nested message back to the expr.
 
template<typename T , typename FType >
NestedMsg< Ttvm::relax::CombineNestedMsg (NestedMsg< T > lhs, NestedMsg< T > rhs, FType fcombine)
 Recursively combine two nested message into one.
 
template<typename T , typename FType >
NestedMsg< Ttvm::relax::MapNestedMsg (NestedMsg< T > msg, FType fmapleaf)
 Recursively map a nested message to another one, with leaf mapped by the input fmapleaf.
 
template<typename T , typename FType >
void tvm::relax::DecomposeNestedMsg (Expr expr, NestedMsg< T > msg, FType fvisitleaf)
 Recursively decompose the tuple structure in expr and msg along with it.
 
template<typename T , std::size_t N, typename FType >
Expr tvm::relax::TransformTupleLeaf (Expr expr, std::array< NestedMsg< T >, N > msgs, FType ftransleaf)
 Recursively transform the tuple structure in expr and msgs along with it.
 
template<typename T , std::size_t N, typename FType >
Type tvm::relax::TransformTupleLeaf (Type ty, std::array< NestedMsg< T >, N > msgs, FType ftransleaf)
 Recursively transform the tuple structure in ty and msgs along with it.
 

Detailed Description

Helper container to store nested message for robust tuple-aware analysis.

Please see NestedMsg for description of usage.

See also
NestedMsg