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

Method test_key_split

python/tests/test_random.py:31–42  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

29 self.assertFalse(mx.array_equal(k1, k2))
30
31 def test_key_split(self):
32 key = mx.random.key(0)
33
34 k1, k2 = mx.random.split(key)
35 self.assertFalse(mx.array_equal(k1, k2))
36
37 r1, r2 = mx.random.split(key)
38 self.assertTrue(mx.array_equal(k1, r1))
39 self.assertTrue(mx.array_equal(k2, r2))
40
41 keys = mx.random.split(key, 10)
42 self.assertEqual(keys.shape, (10, 2))
43
44 def test_uniform(self):
45 key = mx.random.key(0)

Callers

nothing calls this directly

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected