mlx
mlx copied to clipboard
Fix conversion to array
Closes #1066
This is kind of a nanobind issue but one that they have refused to fix in the past.
- Basically a
np.ndarrayis implicitly convertible to astd::complex<float>so ourto_arraywas allowing that. - Rather than disallowing ops with
np.ndarraysinstead I added it as a member in the variant. - That however has side effects because now
mx.arraygets implicitly converted tonb::ndarraybecause of the buffer protocol. - So to fix that I also had to enable
arrayas a member of the variant.