Expand description
Generic elementwise kernels (binary, binary-scalar, unary, comparison,
in-place accumulate). Ported from luma-core’s arith.rs, generalized over
the CpuNum element trait and returning plain Vecs.
Functions§
- binary
out[i] = f(lhs[i], rhs[i])over two (possibly non-contiguous) views of the same logical shape. Mirrors luma-corecompute_binary_op.- binary_
- In-place
dst = f(dst, src)respecting both layouts. Mirrors luma-corebinary_inplace_op; used by the backward pass to accumulate gradients. - binary_
scalar out[i] = f(lhs[i], scalar).- binary_
scalar_ - In-place
dst[i] = f(dst[i], rhs). - cmp_
scalar - Out-of-place comparison against scalar:
out[i] = f(lhs[i], rhs). - float_
unary - Dispatch a float unary op over one view.
- num_
binary - Dispatch a numeric binary op over two views.
- num_
binary_ fn - num_
binary_ scalar - Dispatch a numeric binary-scalar op over one view.
- num_cmp
- Dispatch a comparison op over two views, producing a bool buffer.
- num_
scalar_ binary - Dispatch a numeric scalar-binary op (
scalar OP element) over one view. - scalar_
binary out[i] = f(scalar, rhs[i]).- unary
out[i] = f(x[i]).- unary_
- In-place
dst[i] = f(dst[i]).