mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-15 01:19:21 +08:00
Add conjugate operator (#1100)
* cpu and gpu impl * add mx.conj and array.conj() --------- Co-authored-by: Alex Barron <abarron22@apple.com>
This commit is contained in:
@@ -1584,5 +1584,13 @@ void init_array(nb::module_& m) {
|
||||
"stream"_a = nb::none(),
|
||||
R"pbdoc(
|
||||
Extract a diagonal or construct a diagonal matrix.
|
||||
)pbdoc");
|
||||
)pbdoc")
|
||||
.def(
|
||||
"conj",
|
||||
[](const array& a, StreamOrDevice s) {
|
||||
return mlx::core::conjugate(to_array(a), s);
|
||||
},
|
||||
nb::kw_only(),
|
||||
"stream"_a = nb::none(),
|
||||
"See :func:`conj`.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user