(self)
| 51 | np.testing.assert_allclose(out, expected, atol=1e-2) |
| 52 | |
| 53 | def test_multiply(self): |
| 54 | g = Graph() |
| 55 | a = g.input((4,)) |
| 56 | b = g.input((4,)) |
| 57 | y = a * b |
| 58 | |
| 59 | g.set_input(a, np.array([2, 3, 4, 5], dtype=np.float16)) |
| 60 | g.set_input(b, np.array([3, 4, 5, 6], dtype=np.float16)) |
| 61 | g.execute() |
| 62 | |
| 63 | out = y.numpy() |
| 64 | expected = np.array([6, 12, 20, 30], dtype=np.float16) |
| 65 | np.testing.assert_allclose(out, expected, atol=1e-2) |
| 66 | |
| 67 | def test_divide(self): |
| 68 | g = Graph() |