(self)
| 899 | self.assertEqual(z.tolist(), [5.0, 6.0]) |
| 900 | |
| 901 | def test_array_pickle(self): |
| 902 | dtypes = [ |
| 903 | mx.int8, |
| 904 | mx.int16, |
| 905 | mx.int32, |
| 906 | mx.int64, |
| 907 | mx.uint8, |
| 908 | mx.uint16, |
| 909 | mx.uint32, |
| 910 | mx.uint64, |
| 911 | mx.float16, |
| 912 | mx.float32, |
| 913 | mx.bfloat16, |
| 914 | mx.complex64, |
| 915 | ] |
| 916 | |
| 917 | for dtype in dtypes: |
| 918 | x = mx.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], dtype=dtype) |
| 919 | state = pickle.dumps(x) |
| 920 | y = pickle.loads(state) |
| 921 | self.assertEqualArray(y, x) |
| 922 | |
| 923 | def test_array_copy(self): |
| 924 | dtypes = [ |
nothing calls this directly
no test coverage detected