()
| 23 | |
| 24 | |
| 25 | def test_structural_key_basic() -> None: |
| 26 | k1 = tvm_ffi.StructuralKey({"a": [1, 2], "b": [3, {"c": 4}]}) |
| 27 | k2 = tvm_ffi.StructuralKey({"b": [3, {"c": 4}], "a": [1, 2]}) |
| 28 | k3 = tvm_ffi.StructuralKey({"a": [1, 2], "b": [3, {"c": 5}]}) |
| 29 | |
| 30 | assert tvm_ffi.structural_hash(k1.key) == k1.__hash__() |
| 31 | assert tvm_ffi.structural_hash(k2.key) == k2.__hash__() |
| 32 | |
| 33 | assert k1 == k2 |
| 34 | assert k1 != k3 |
| 35 | assert hash(k1) == hash(k2) |
| 36 | assert tvm_ffi.structural_equal(k1.key, k2.key) |
| 37 | assert not tvm_ffi.structural_equal(k1.key, k3.key) |
| 38 | |
| 39 | |
| 40 | def test_structural_helpers() -> None: |
nothing calls this directly
no test coverage detected