mlx icon indicating copy to clipboard operation
mlx copied to clipboard

Feature: Implement buffer protocol for `mlx.core` `array` to support `memoryview`

Open dastrobu opened this issue 1 year ago • 1 comments

mlx.core arrays are great already. To support better interoperability with other frameworks, even mlx.data, implementing the buffer protocol as for numpy arrays would help.

This should address https://github.com/ml-explore/mlx-data/issues/20 and will allow to use memoryview from python.

dastrobu avatar Dec 30 '23 08:12 dastrobu

Gave it a quick shot in #323. There are some little edge cases, see inline comments in the draft PR.

dastrobu avatar Dec 30 '23 16:12 dastrobu