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

Function test_binding_block

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

Source from the content-addressed store, hash-verified

141
142
143def test_binding_block() -> None:
144 m = tirx.Var("m", dtype="int64")
145 n = tirx.Var("n", dtype="int64")
146 shape = rx.const([16, 8], "int32")
147 b0 = rx.MatchCast(rx.Var("v0"), shape, R.Tensor([m, n], "int32"))
148
149 v0 = rx.Var("v0")
150 val = rx.const(np.random.rand(24, 56))
151 b1 = rx.VarBinding(v0, val)
152
153 block0 = rx.BindingBlock([b0, b1])
154 block0_str = dump_ast(block0)
155 assert block0_str.startswith("BindingBlock(")
156 assert "bindings=" in block0_str
157 assert "VarBinding(" in block0_str
158 assert "MatchCast(" in block0_str
159 assert '"v0"' in block0_str
160
161
162def test_dataflow_block() -> 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…