Bump nanobind to 2.4 + fix (#1710)

* bump nanobind to 2.4 + fix

* fix
This commit is contained in:
Awni Hannun
2024-12-17 10:57:54 -08:00
committed by GitHub
parent a6b426422e
commit f110357aaa
11 changed files with 36 additions and 21 deletions

View File

@@ -12,6 +12,11 @@
namespace mx = mlx::core;
namespace nb = nanobind;
struct ArrayLike {
ArrayLike(nb::object obj) : obj(obj) {};
nb::object obj;
};
using ArrayInitType = std::variant<
nb::bool_,
nb::int_,
@@ -23,7 +28,7 @@ using ArrayInitType = std::variant<
std::complex<float>,
nb::list,
nb::tuple,
nb::object>;
ArrayLike>;
mx::array nd_array_to_mlx(
nb::ndarray<nb::ro, nb::c_contig, nb::device::cpu> nd_array,