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

Method test_square

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

Source from the content-addressed store, hash-verified

894 self.assertTrue(np.array_equal(result, expected))
895
896 def test_square(self):
897 a = mx.array([0.1, 0.5, 1.0, 10.0])
898 result = mx.square(a)
899 expected = np.square(a, dtype=np.float32)
900
901 self.assertTrue(np.allclose(result, expected))
902
903 def test_sqrt(self):
904 a = mx.array([0.1, 0.5, 1.0, 10.0])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected