(self)
| 44 | self.assertTrue(mx.all(result >= low) and mx.all(result <= high)) |
| 45 | |
| 46 | def test_identity(self): |
| 47 | for dtype in [mx.float32, mx.float16]: |
| 48 | initializer = init.identity(dtype) |
| 49 | for shape in [(3,), (3, 3), (3, 3, 3)]: |
| 50 | result = initializer(mx.zeros((3, 3))) |
| 51 | self.assertTrue(mx.array_equal(result, mx.eye(3))) |
| 52 | self.assertEqual(result.dtype, dtype) |
| 53 | with self.assertRaises(ValueError): |
| 54 | result = initializer(mx.zeros((3, 2))) |
| 55 | |
| 56 | def test_glorot_normal(self): |
| 57 | for dtype in [mx.float32, mx.float16]: |
nothing calls this directly
no test coverage detected