MCPcopy Create free account
hub / github.com/ml-explore/mlx / test_ops

Method test_ops

python/tests/test_ops.py:1521–1525  ·  view source on GitHub ↗
(npop, mlxop, x, y, atol, rtol)

Source from the content-addressed store, hash-verified

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"]:

Callers

nothing calls this directly

Calls 1

evalMethod · 0.45

Tested by

no test coverage detected