(self)
| 65 | np.testing.assert_allclose(out, expected, atol=1e-2) |
| 66 | |
| 67 | def test_divide(self): |
| 68 | g = Graph() |
| 69 | a = g.input((4,)) |
| 70 | b = g.input((4,)) |
| 71 | y = a / b |
| 72 | |
| 73 | g.set_input(a, np.array([10, 20, 30, 40], dtype=np.float16)) |
| 74 | g.set_input(b, np.array([2, 4, 5, 8], dtype=np.float16)) |
| 75 | g.execute() |
| 76 | |
| 77 | out = y.numpy() |
| 78 | expected = np.array([5, 5, 6, 5], dtype=np.float16) |
| 79 | np.testing.assert_allclose(out, expected, atol=1e-2) |
| 80 | |
| 81 | |
| 82 | class TestGraphComposed(unittest.TestCase): |