tvm
|
The default handler for equality testing. More...
#include <structural_equal.h>
Public Member Functions | |
SEqualHandlerDefault (bool assert_mode, Optional< ObjectPathPair > *first_mismatch, bool defer_fails) | |
virtual | ~SEqualHandlerDefault () |
bool | SEqualReduce (const ObjectRef &lhs, const ObjectRef &rhs, bool map_free_vars, const Optional< ObjectPathPair > ¤t_paths) override |
Reduce condition to equality of lhs and rhs. More... | |
void | DeferFail (const ObjectPathPair &mismatch_paths) override |
Mark the comparison as failed, but don't fail immediately. More... | |
bool | IsFailDeferralEnabled () override |
Check if fail defferal is enabled. More... | |
ObjectRef | MapLhsToRhs (const ObjectRef &lhs) override |
Lookup the graph node equal map for vars that are already mapped. More... | |
void | MarkGraphNode () override |
Mark current comparison as graph node equal comparison. More... | |
virtual bool | Equal (const ObjectRef &lhs, const ObjectRef &rhs, bool map_free_vars) |
The entry point for equality testing. More... | |
Protected Member Functions | |
virtual bool | DispatchSEqualReduce (const ObjectRef &lhs, const ObjectRef &rhs, bool map_free_vars, const Optional< ObjectPathPair > ¤t_paths) |
The dispatcher for equality testing of intermediate objects. More... | |
Additional Inherited Members | |
Protected Types inherited from tvm::SEqualReducer::Handler | |
using | PathTracingData = SEqualReducer::PathTracingData |
The default handler for equality testing.
Users can derive from this class and override the DispatchSEqualReduce method, to customize equality testing.
tvm::SEqualHandlerDefault::SEqualHandlerDefault | ( | bool | assert_mode, |
Optional< ObjectPathPair > * | first_mismatch, | ||
bool | defer_fails | ||
) |
|
virtual |
|
overridevirtual |
Mark the comparison as failed, but don't fail immediately.
This is useful for producing better error messages when comparing containers. For example, if two array sizes mismatch, it's better to mark the comparison as failed but compare array elements anyway, so that we could find the true first mismatch.
Implements tvm::SEqualReducer::Handler.
|
protectedvirtual |
The dispatcher for equality testing of intermediate objects.
lhs | The left operand. |
rhs | The right operand. |
map_free_vars | Whether or not to remap variables if possible. |
current_paths | Optional paths to lhs and rhs objects, for error traceability. |
|
virtual |
The entry point for equality testing.
lhs | The left operand. |
rhs | The right operand. |
map_free_vars | Whether or not to remap variables if possible. |
|
overridevirtual |
Check if fail defferal is enabled.
Implements tvm::SEqualReducer::Handler.
Lookup the graph node equal map for vars that are already mapped.
This is an auxiliary method to check the Map<Var, Value> equality.
lhs | an lhs value. |
Implements tvm::SEqualReducer::Handler.
|
overridevirtual |
Mark current comparison as graph node equal comparison.
Implements tvm::SEqualReducer::Handler.
|
overridevirtual |
Reduce condition to equality of lhs and rhs.
lhs | The left operand. |
rhs | The right operand. |
map_free_vars | Whether do we allow remap variables if possible. |
current_paths | Optional paths to lhs and rhs objects, for error traceability. |
Implements tvm::SEqualReducer::Handler.