tvm_ffi.structural_hash#
- tvm_ffi.structural_hash(value, map_free_vars=False, skip_tensor_content=False)[source]#
Compute structural hash of a value.
This hash is designed to be consistent with
structural_equal()under the same options. If two values are structurally equal, they should have the same structural hash.- Parameters:
- Return type:
- Returns:
hash_value – Structural hash value.
Examples
import tvm_ffi h0 = tvm_ffi.structural_hash([1, 2, 3]) h1 = tvm_ffi.structural_hash([1, 2, 3]) assert h0 == h1
Notes
Structural hash is intended for hash-table bucketing and fast pre-checks. Always use structural equality to confirm semantic equivalence.