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

Method test_log2

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

Source from the content-addressed store, hash-verified

954 self.assertTrue(np.allclose(result, expected))
955
956 def test_log2(self):
957 a = mx.array([0.5, 1, 2, 10, 16])
958 result = mx.log2(a)
959 expected = np.log2(a, dtype=np.float32)
960
961 self.assertTrue(np.allclose(result, expected))
962
963 a = mx.array(1.0) + 1j * mx.array(2.0)
964 result = mx.log2(a)
965 expected = np.log2(np.array(a))
966 self.assertTrue(np.allclose(result, expected))
967
968 def test_log10(self):
969 a = mx.array([0.1, 1, 10, 20, 100])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected