Internal handler that defines custom behaviors.
More...
#include <structural_hash.h>
Internal handler that defines custom behaviors.
◆ LookupHashedValue()
virtual bool tvm::SHashReducer::Handler::LookupHashedValue |
( |
const ObjectRef & |
key, |
|
|
uint64_t * |
hashed_value |
|
) |
| |
|
pure virtual |
Lookup a hash value for key.
- Parameters
-
key | The hash key. |
hashed_value | the result hash value |
- Returns
- Whether there is already a pre-computed hash value.
Implemented in tvm::SHashHandlerDefault.
◆ MarkGraphNode()
virtual void tvm::SHashReducer::Handler::MarkGraphNode |
( |
| ) |
|
|
pure virtual |
Mark current comparison as graph node in hashing. Graph node hash will depends on the graph structure.
Implemented in tvm::SHashHandlerDefault.
◆ SHashReduce()
virtual void tvm::SHashReducer::Handler::SHashReduce |
( |
const ObjectRef & |
key, |
|
|
bool |
map_free_vars |
|
) |
| |
|
pure virtual |
Append hash value of key to the current sequence of hashes.
- Parameters
-
key | The object to compute hash from. |
map_free_vars | Whether to map free variables by their occurrence number. |
Implemented in tvm::SHashHandlerDefault.
◆ SHashReduceFreeVar()
virtual void tvm::SHashReducer::Handler::SHashReduceFreeVar |
( |
const runtime::Object * |
var, |
|
|
bool |
map_free_vars |
|
) |
| |
|
pure virtual |
Append a hash value of free variable to the current sequence of hashes.
- Parameters
-
var | The var of interest. |
map_free_vars | Whether to map free variables by their occurrence number. |
- Note
- If map_free_vars is set to be true, internally the handler can maintain a counter to encode free variables by their order of occurrence. This helps to resolve variable mapping of function parameters and let binding variables.
If map_free_vars is set to be false, the address of the variable will be used.
Implemented in tvm::SHashHandlerDefault.
◆ SHashReduceHashedValue()
virtual void tvm::SHashReducer::Handler::SHashReduceHashedValue |
( |
uint64_t |
hashed_value | ) |
|
|
pure virtual |
Append hashed_value to the current sequence of hashes.
- Parameters
-
hashed_value | The hashed value |
Implemented in tvm::SHashHandlerDefault.
The documentation for this class was generated from the following file: