tvm
|
Content-aware structural equality comparator for objects. More...
#include <structural_equal.h>
Public Member Functions | |
bool | operator() (const ObjectRef &lhs, const ObjectRef &rhs, const bool map_free_params=false) const |
Compare objects via strutural equal. More... | |
Public Member Functions inherited from tvm::BaseValueEqual | |
bool | operator() (const double &lhs, const double &rhs) const |
bool | operator() (const int64_t &lhs, const int64_t &rhs) const |
bool | operator() (const uint64_t &lhs, const uint64_t &rhs) const |
bool | operator() (const int &lhs, const int &rhs) const |
bool | operator() (const bool &lhs, const bool &rhs) const |
bool | operator() (const std::string &lhs, const std::string &rhs) const |
bool | operator() (const DataType &lhs, const DataType &rhs) const |
template<typename ENum , typename = typename std::enable_if<std::is_enum<ENum>::value>::type> | |
bool | operator() (const ENum &lhs, const ENum &rhs) const |
Content-aware structural equality comparator for objects.
The structural equality is recursively defined in the DAG of IR nodes via SEqual. There are two kinds of nodes:
Vars(tir::Var, TypeVar) and non-constant relay expression nodes are graph nodes. For example, it means that %1 = x + y; %1 + %1
is not structurally equal to %1 = x + y; %2 = x + y; %1 + %2
in relay.
A var-type node(e.g. tir::Var, TypeVar) can be mapped as equal to another var with the same type if one of the following condition holds:
bool tvm::StructuralEqual::operator() | ( | const ObjectRef & | lhs, |
const ObjectRef & | rhs, | ||
const bool | map_free_params = false |
||
) | const |
Compare objects via strutural equal.
lhs | The left operand. |
rhs | The right operand. |
map_free_params | Whether or not to map free variables. |