()
| 9 | |
| 10 | |
| 11 | def test_io(): |
| 12 | g = mgb_graph.Graph() |
| 13 | x = Tensor(np.random.randn(3).astype("float32"), device="xpux")._dev_tensor() |
| 14 | vx, _ = mgb_graph.input_callback( |
| 15 | lambda: x, device=x.comp_node, dtype=x.dtype, graph=g |
| 16 | ) |
| 17 | y = Future() |
| 18 | v = mgb_graph.output_callback(y.set_result, vx) |
| 19 | f = g.compile(v) |
| 20 | f() |
| 21 | |
| 22 | np.testing.assert_equal(x.numpy(), y.result().numpy()) |
| 23 | |
| 24 | |
| 25 | def test_io2(): |
nothing calls this directly
no test coverage detected