()
| 23 | |
| 24 | |
| 25 | def test_io2(): |
| 26 | g = mgb_graph.Graph() |
| 27 | g.options.async_exec_level = 0b100 |
| 28 | dtype, device = "float32", "xpux" |
| 29 | px = mgb_graph.InputNode(device=device, dtype=dtype, graph=g) |
| 30 | py = mgb_graph.OutputNode(px.outputs[0]) |
| 31 | f = g.compile(py.outputs[0]) |
| 32 | |
| 33 | for _ in range(3): |
| 34 | f.execute() |
| 35 | x = Tensor(np.random.randn(10).astype(dtype), device=device)._dev_tensor() |
| 36 | px.set_value(x) |
| 37 | y = py.get_value() |
| 38 | np.testing.assert_equal(x.numpy(), y.numpy()) |
| 39 | f.wait() |
| 40 | |
| 41 | |
| 42 | def test_attr_output(): |
nothing calls this directly
no test coverage detected