-
Currently, if I want to serialize the MLX tensor, I have to convert it to a numpy array, then use |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
MLX implements the Python buffer protocol. So you can do: >>> a =mx.array([1,2,3])
>>> x = memoryview(a)
>>> mx.array(x)
array([1, 2, 3], dtype=int32) I'm curious though why not use |
Beta Was this translation helpful? Give feedback.
MLX implements the Python buffer protocol. So you can do:
I'm curious though why not use
mx.distributed
? It will generally be faster as it keeps the communication ops inside the graph and avoids unnecessary copies.