diff --git a/python/src/array.cpp b/python/src/array.cpp index ddf27e68f..4395d50e6 100644 --- a/python/src/array.cpp +++ b/python/src/array.cpp @@ -1110,7 +1110,8 @@ void init_array(py::module_& m) { py::kw_only(), "stream"_a = none, "See :func:`abs`.") - .def("__abs__", &mlx::core::abs, "See :func:`abs`.") + .def( + "__abs__", [](const array& a) { return abs(a); }, "See :func:`abs`.") .def( "square", &square,