From f242b4249334716f0ff09bdfed2c3673f9c29a09 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Mon, 1 Jan 2024 22:34:38 -0500 Subject: [PATCH] spelling: element-wise Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- docs/src/dev/extensions.rst | 6 +++--- examples/extensions/axpby/axpby.cpp | 4 ++-- examples/extensions/axpby/axpby.h | 2 +- examples/extensions/bindings.cpp | 2 +- tests/autograd_tests.cpp | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/src/dev/extensions.rst b/docs/src/dev/extensions.rst index 683014a3f..90aca6b07 100644 --- a/docs/src/dev/extensions.rst +++ b/docs/src/dev/extensions.rst @@ -69,7 +69,7 @@ C++ API: .. code-block:: C++ /** - * Scale and sum two vectors elementwise + * Scale and sum two vectors element-wise * z = alpha * x + beta * y * * Follow numpy style broadcasting between x and y @@ -284,7 +284,7 @@ pointwise. This is captured in the templated function :meth:`axpby_impl`. T alpha = static_cast(alpha_); T beta = static_cast(beta_); - // Do the elementwise operation for each output + // Do the element-wise operation for each output for (size_t out_idx = 0; out_idx < out.size(); out_idx++) { // Map linear indices to offsets in x and y auto x_offset = elem_to_loc(out_idx, x.shape(), x.strides()); @@ -697,7 +697,7 @@ are already provided, adding our :meth:`axpby` becomes very simple! py::kw_only(), "stream"_a = py::none(), R"pbdoc( - Scale and sum two vectors elementwise + Scale and sum two vectors element-wise ``z = alpha * x + beta * y`` Follows numpy style broadcasting between ``x`` and ``y`` diff --git a/examples/extensions/axpby/axpby.cpp b/examples/extensions/axpby/axpby.cpp index 07720c371..5d033c70c 100644 --- a/examples/extensions/axpby/axpby.cpp +++ b/examples/extensions/axpby/axpby.cpp @@ -26,7 +26,7 @@ namespace mlx::core { /////////////////////////////////////////////////////////////////////////////// /** - * Scale and sum two vectors elementwise + * Scale and sum two vectors element-wise * z = alpha * x + beta * y * * Follow numpy style broadcasting between x and y @@ -91,7 +91,7 @@ void axpby_impl( T alpha = static_cast(alpha_); T beta = static_cast(beta_); - // Do the elementwise operation for each output + // Do the element-wise operation for each output for (size_t out_idx = 0; out_idx < out.size(); out_idx++) { // Map linear indices to offsets in x and y auto x_offset = elem_to_loc(out_idx, x.shape(), x.strides()); diff --git a/examples/extensions/axpby/axpby.h b/examples/extensions/axpby/axpby.h index 9ff6af0b1..3f470fd50 100644 --- a/examples/extensions/axpby/axpby.h +++ b/examples/extensions/axpby/axpby.h @@ -12,7 +12,7 @@ namespace mlx::core { /////////////////////////////////////////////////////////////////////////////// /** - * Scale and sum two vectors elementwise + * Scale and sum two vectors element-wise * z = alpha * x + beta * y * * Follow numpy style broadcasting between x and y diff --git a/examples/extensions/bindings.cpp b/examples/extensions/bindings.cpp index 661ddcbaf..d05e6b636 100644 --- a/examples/extensions/bindings.cpp +++ b/examples/extensions/bindings.cpp @@ -23,7 +23,7 @@ PYBIND11_MODULE(mlx_sample_extensions, m) { py::kw_only(), "stream"_a = py::none(), R"pbdoc( - Scale and sum two vectors elementwise + Scale and sum two vectors element-wise ``z = alpha * x + beta * y`` Follows numpy style broadcasting between ``x`` and ``y`` diff --git a/tests/autograd_tests.cpp b/tests/autograd_tests.cpp index 85dad9160..a7b7e7fca 100644 --- a/tests/autograd_tests.cpp +++ b/tests/autograd_tests.cpp @@ -989,7 +989,7 @@ TEST_CASE("test as_strided grads") { } TEST_CASE("test jvp from vjp") { - // Unary elementwise ops + // Unary element-wise ops { auto x = random::uniform({5, 10}); eval(x); @@ -1022,7 +1022,7 @@ TEST_CASE("test jvp from vjp") { CHECK(compute_derivs(mlx::core::rsqrt)); } - // Binary elementwise ops + // Binary element-wise ops { auto x = random::uniform({5, 10}); auto y = random::uniform({5, 10});