| 160 | |
| 161 | |
| 162 | def 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 | |
| 181 | def test_seq_expr() -> None: |