Skip to main content

Module ops

Module ops 

Source
Expand description

Element-wise and pointwise array operations built on the NdArray abstraction.

Most operations in this module currently require:

  • host-accessible memory
  • contiguous, row-major layout

Functions return Box<dyn NdArray> whose concrete backend is derived from the left-hand operand (via NdArray::zeros).

Functionsยง

abs
Element-wise absolute value (abs(x)).
acos
Element-wise arccosine (acos(x)).
add
Element-wise addition (a + b).
add_scalar
Add a scalar to every element (array + scalar).
asin
Element-wise arcsine (asin(x)).
atan
Element-wise arctangent (atan(x)).
cos
Element-wise cosine (cos(x)).
exp
Element-wise exponential (exp(x)).
log
Element-wise natural logarithm (ln(x)).
matmul
Matrix multiplication of two 2D arrays.
mul
Element-wise multiplication (a * b).
pow
Element-wise power (array.powf(exponent)).
sign
Element-wise sign function (-1, 0, 1).
sin
Element-wise sine (sin(x)).
sqrt
Element-wise square root (sqrt(x)).
tan
Element-wise tangent (tan(x)).