mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-18 18:28:12 +08:00
Adds radians and degrees (#1011)
This commit is contained in:
@@ -1032,6 +1032,40 @@ void init_ops(nb::module_& m) {
|
||||
Returns:
|
||||
array: The inverse hyperbolic tangent of ``a``.
|
||||
)pbdoc");
|
||||
m.def(
|
||||
"degrees",
|
||||
&mlx::core::degrees,
|
||||
nb::arg(),
|
||||
nb::kw_only(),
|
||||
"stream"_a = nb::none(),
|
||||
nb::sig(
|
||||
"def degrees(a: array, /, *, stream: Union[None, Stream, Device] = None) -> array"),
|
||||
R"pbdoc(
|
||||
Convert angles from radians to degrees.
|
||||
|
||||
Args:
|
||||
a (array): Input array.
|
||||
|
||||
Returns:
|
||||
array: The angles in degrees.
|
||||
)pbdoc");
|
||||
m.def(
|
||||
"radians",
|
||||
&mlx::core::radians,
|
||||
nb::arg(),
|
||||
nb::kw_only(),
|
||||
"stream"_a = nb::none(),
|
||||
nb::sig(
|
||||
"def radians(a: array, /, *, stream: Union[None, Stream, Device] = None) -> array"),
|
||||
R"pbdoc(
|
||||
Convert angles from degrees to radians.
|
||||
|
||||
Args:
|
||||
a (array): Input array.
|
||||
|
||||
Returns:
|
||||
array: The angles in radians.
|
||||
)pbdoc");
|
||||
m.def(
|
||||
"log",
|
||||
&mlx::core::log,
|
||||
|
Reference in New Issue
Block a user