(self)
| 112 | class TestGraphTensorOps(unittest.TestCase): |
| 113 | |
| 114 | def test_view(self): |
| 115 | g = Graph() |
| 116 | a = g.input((2, 3)) |
| 117 | y = a.view((6,)) |
| 118 | |
| 119 | g.set_input(a, np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float16)) |
| 120 | g.execute() |
| 121 | |
| 122 | out = y.numpy() |
| 123 | expected = np.array([1, 2, 3, 4, 5, 6], dtype=np.float16) |
| 124 | np.testing.assert_allclose(out, expected, atol=1e-2) |
| 125 | |
| 126 | def test_flatten(self): |
| 127 | g = Graph() |