(self)
| 921 | self.assertEqualArray(y, x) |
| 922 | |
| 923 | def test_array_copy(self): |
| 924 | dtypes = [ |
| 925 | mx.int8, |
| 926 | mx.int16, |
| 927 | mx.int32, |
| 928 | mx.int64, |
| 929 | mx.uint8, |
| 930 | mx.uint16, |
| 931 | mx.uint32, |
| 932 | mx.uint64, |
| 933 | mx.float16, |
| 934 | mx.float32, |
| 935 | mx.bfloat16, |
| 936 | mx.complex64, |
| 937 | ] |
| 938 | |
| 939 | for copy_function in [copy, deepcopy]: |
| 940 | for dtype in dtypes: |
| 941 | x = mx.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], dtype=dtype) |
| 942 | y = copy_function(x) |
| 943 | self.assertEqualArray(y, x) |
| 944 | |
| 945 | y -= 1 |
| 946 | self.assertEqualArray(y, x - 1) |
| 947 | |
| 948 | def test_indexing(self): |
| 949 | # Only ellipsis is a no-op |
nothing calls this directly
no test coverage detected