Template Class PVar#

Inheritance Relationships#

Base Type#

Class Documentation#

template<typename T>
class PVar : public tvm::Pattern<PVar<T>>#

Pattern variable container.

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

Note

PVar is not thread safe. Do not use the same PVar in multiple threads.

Template Parameters:

T – the type of the hole.

Public Types

using Nested = const PVar<T>&#

Public Functions

inline void InitMatch_() const#
inline 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>
inline bool Match_(const NodeRefType &value) const#
inline T Eval() const#
inline T EvalOr(const T &default_value) const#

Protected Attributes

mutable std::optional<T> value_#

The matched value.