MCPcopy Create free account
hub / github.com/apache/tvm / test_and_pattern

Function test_and_pattern

tests/python/relax/test_dataflow_pattern.py:215–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

213
214
215def test_and_pattern():
216 # float[2, 3, 3]
217 f32_233 = wildcard().has_shape((2, 3, 3)) & has_dtype("float32")
218 assert isinstance(f32_233, AndPattern)
219 assert f32_233.match(rx.Var("x", R.Tensor((2, 3, 3), "float32")))
220 assert not f32_233.match(rx.Var("x", R.Tensor((3, 3, 3), "float32")))
221 assert not f32_233.match(rx.Var("x", R.Tensor("float32", ndim=3)))
222
223
224def test_not_pattern():

Callers

nothing calls this directly

Calls 5

wildcardFunction · 0.85
has_dtypeFunction · 0.85
has_shapeMethod · 0.80
TensorMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…