()
| 559 | |
| 560 | |
| 561 | def test_tuple_get_item(): |
| 562 | @R.function |
| 563 | def foo(x: R.Tensor, y: R.Tensor): |
| 564 | t1 = R.tuple(x, y) |
| 565 | t2 = (x, y) |
| 566 | a = t1[0] |
| 567 | b = R.TupleGetItem(t2, 1) |
| 568 | c = R.add(a, b) |
| 569 | return c |
| 570 | |
| 571 | x = relax.Var("x", R.Tensor()) |
| 572 | y = relax.Var("y", R.Tensor()) |
| 573 | bb = relax.BlockBuilder() |
| 574 | with bb.function("foo", (x, y)): |
| 575 | t1 = bb.emit(relax.Tuple([x, y])) |
| 576 | t2 = bb.emit(relax.Tuple([x, y])) |
| 577 | a = bb.emit(relax.TupleGetItem(t1, 0)) |
| 578 | b = bb.emit(relax.TupleGetItem(t2, 1)) |
| 579 | c = bb.emit(relax.op.add(a, b)) |
| 580 | bb.emit_func_output(c) |
| 581 | |
| 582 | _check(foo, bb.get()["foo"]) |
| 583 | |
| 584 | |
| 585 | def test_dataflow_block(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…