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

Method test_negative

python/tests/test_ops.py:847–851  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

845 self.assertTrue(np.allclose(a.abs(), abs(a)))
846
847 def test_negative(self):
848 a = mx.array([-1.0, 1.0, -2.0, 3.0])
849 result = mx.negative(a)
850 expected = np.negative(a, dtype=np.float32)
851 self.assertTrue(np.allclose(result, expected))
852
853 def test_sign(self):
854 a = mx.array([-1.0, 1.0, 0.0, -2.0, 3.0])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected