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

Method test_floor

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

Source from the content-addressed store, hash-verified

473 self.assertTrue(math.isnan(mx.maximum(b, a).item()))
474
475 def test_floor(self):
476 x = mx.array([-22.03, 19.98, -27, 9, 0.0, -np.inf, np.inf])
477 expected = [-23, 19, -27, 9, 0, -np.inf, np.inf]
478 self.assertListEqual(mx.floor(x).tolist(), expected)
479
480 with self.assertRaises(ValueError):
481 mx.floor(mx.array([22 + 3j, 19 + 98j]))
482
483 def test_ceil(self):
484 x = mx.array([-22.03, 19.98, -27, 9, 0.0, -np.inf, np.inf])

Callers

nothing calls this directly

Calls 1

arrayMethod · 0.60

Tested by

no test coverage detected