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

Function test_op_attr

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

Source from the content-addressed store, hash-verified

274
275
276def test_op_attr():
277 x = rx.Var("x", R.Tensor("float32"))
278 y = rx.Var("y", R.Tensor("float32"))
279 conv2d = rx.op.nn.conv2d(x, y, strides=(3, 3))
280 xp = is_var("x")
281 yp = is_var("y")
282 assert is_op("relax.nn.conv2d")(xp, yp).has_attr({"strides": [3, 3]}).match(conv2d)
283 assert not is_op("relax.nn.conv2d")(xp, yp).has_attr({"strides": [4, 3]}).match(conv2d)
284
285
286def test_match_call_attr():

Callers

nothing calls this directly

Calls 6

is_varFunction · 0.85
is_opFunction · 0.85
TensorMethod · 0.80
conv2dMethod · 0.45
matchMethod · 0.45
has_attrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…