MCPcopy Create free account
hub / github.com/apache/tvm-ffi / test_same_dag_shape

Method test_same_dag_shape

tests/python/test_structural_py_class.py:281–287  ·  view source on GitHub ↗

Two DAGs with the same sharing shape are equal.

(self)

Source from the content-addressed store, hash-verified

279 """Test structural_eq="dag" kind."""
280
281 def test_same_dag_shape(self) -> None:
282 """Two DAGs with the same sharing shape are equal."""
283 s1 = TBinding(name="s", value=1)
284 s2 = TBinding(name="s", value=1)
285 dag1 = tvm_ffi.Array([s1, s1]) # shared
286 dag2 = tvm_ffi.Array([s2, s2]) # shared (same shape)
287 assert structural_equal(dag1, dag2)
288
289 def test_dag_vs_tree_not_equal(self) -> None:
290 """A DAG (shared) vs tree (independent copies) are NOT equal."""

Callers

nothing calls this directly

Calls 3

structural_equalFunction · 0.90
TBindingClass · 0.85
ArrayMethod · 0.80

Tested by

no test coverage detected