tvm
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
tvm::PVar< T > Class Template Reference

Pattern variable container. More...

#include <pattern_match.h>

Inheritance diagram for tvm::PVar< T >:
Collaboration diagram for tvm::PVar< T >:

Public Types

using Nested = const PVar< T > &
 
- Public Types inherited from tvm::Pattern< PVar< T > >
using Nested = PVar< T >
 Nested storage type in the expression.
 

Public Member Functions

void InitMatch_ () const
 
bool Match_ (const T &value) const
 
template<typename NodeRefType , typename = typename std::enable_if< !std::is_same<NodeRefType, T>::value && std::is_base_of<ffi::ObjectRef, NodeRefType>::value && std::is_base_of<ffi::ObjectRef, T>::value>::type>
bool Match_ (const NodeRefType &value) const
 
T Eval () const
 
T EvalOr (const T &default_value) const
 
- Public Member Functions inherited from tvm::Pattern< PVar< T > >
bool Match (const NodeType &value) const
 Check if value matches the current pattern.
 
bool Match (const NodeType &value, Condition cond) const
 Check if value matches the current pattern.
 
const PVar< T > & derived () const
 

Protected Attributes

std::optional< T > value_
 The matched value.
 

Detailed Description

template<typename T>
class tvm::PVar< T >

Pattern variable container.

PVar is used as a "hole" in the pattern that can be matched.

Template Parameters
Tthe type of the hole.
Note
PVar is not thread safe. Do not use the same PVar in multiple threads.

Member Typedef Documentation

◆ Nested

template<typename T >
using tvm::PVar< T >::Nested = const PVar<T>&

Member Function Documentation

◆ Eval()

template<typename T >
T tvm::PVar< T >::Eval ( ) const
inline

◆ EvalOr()

template<typename T >
T tvm::PVar< T >::EvalOr ( const T &  default_value) const
inline

◆ InitMatch_()

template<typename T >
void tvm::PVar< T >::InitMatch_ ( ) const
inline

◆ Match_() [1/2]

template<typename T >
template<typename NodeRefType , typename = typename std::enable_if< !std::is_same<NodeRefType, T>::value && std::is_base_of<ffi::ObjectRef, NodeRefType>::value && std::is_base_of<ffi::ObjectRef, T>::value>::type>
bool tvm::PVar< T >::Match_ ( const NodeRefType &  value) const
inline

◆ Match_() [2/2]

template<typename T >
bool tvm::PVar< T >::Match_ ( const T &  value) const
inline

Member Data Documentation

◆ value_

template<typename T >
std::optional<T> tvm::PVar< T >::value_
mutableprotected

The matched value.


The documentation for this class was generated from the following file: