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

Function test_dataflow_block

tests/python/relax/test_ast_printer.py:162–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160
161
162def test_dataflow_block() -> None:
163 m = tirx.Var("m", dtype="int64")
164 n = tirx.Var("n", dtype="int64")
165 shape = rx.const([16, 8], "int32")
166 b0 = rx.MatchCast(rx.Var("v0"), shape, R.Tensor([m, n], "int32"))
167
168 v0 = rx.Var("v0")
169 val = rx.const(np.random.rand(24, 56))
170 b1 = rx.VarBinding(v0, val)
171
172 block0 = rx.DataflowBlock([b0, b1])
173 block0_str = dump_ast(block0)
174 assert block0_str.startswith("DataflowBlock(")
175 assert "bindings=" in block0_str
176 assert "VarBinding(" in block0_str
177 assert "MatchCast(" in block0_str
178 assert '"v0"' in block0_str
179
180
181def test_seq_expr() -> None:

Callers

nothing calls this directly

Calls 2

dump_astFunction · 0.90
TensorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…