mlx
mlx copied to clipboard
Feature: Implement buffer protocol for `mlx.core` `array` to support `memoryview`
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.
Gave it a quick shot in #323. There are some little edge cases, see inline comments in the draft PR.