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

Method test_array_pickle

python/tests/test_array.py:901–921  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 = [

Callers

nothing calls this directly

Calls 2

assertEqualArrayMethod · 0.80
arrayMethod · 0.60

Tested by

no test coverage detected