(npop, mlxop, x, y, atol, rtol)
| 1519 | |
| 1520 | def test_unary_ops(self): |
| 1521 | def test_ops(npop, mlxop, x, y, atol, rtol): |
| 1522 | r_np = npop(x) |
| 1523 | r_mlx = mlxop(y) |
| 1524 | mx.eval(r_mlx) |
| 1525 | self.assertTrue(np.allclose(r_np, r_mlx, atol=atol, rtol=rtol)) |
| 1526 | |
| 1527 | x = np.random.rand(18, 28, 38) |
| 1528 | for op in ["abs", "exp", "log", "square", "sqrt"]: |