Fix np bfloat16 misinterpreted as complex (#3146)
Co-authored-by: Cheng <git@zcbenz.com>
This commit is contained in:
@@ -296,7 +296,7 @@ void init_array(nb::module_& m) {
|
||||
nb::is_weak_referenceable())
|
||||
.def(
|
||||
"__init__",
|
||||
[](mx::array* aptr, ArrayInitType v, std::optional<mx::Dtype> t) {
|
||||
[](mx::array* aptr, nb::object v, std::optional<mx::Dtype> t) {
|
||||
new (aptr) mx::array(create_array(v, t));
|
||||
},
|
||||
"val"_a,
|
||||
@@ -492,7 +492,7 @@ void init_array(nb::module_& m) {
|
||||
reinterpret_cast<const size_t*>(nd.shape_ptr()),
|
||||
owner,
|
||||
nullptr,
|
||||
nb::bfloat16),
|
||||
nb::dtype<mx::bfloat16_t>()),
|
||||
mx::bfloat16));
|
||||
} else {
|
||||
new (&arr) mx::array(nd_array_to_mlx(nd, std::nullopt));
|
||||
|
||||
Reference in New Issue
Block a user