Arithmetic Operations
Element-wise addition with broadcasting.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise subtraction with broadcasting.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise multiplication with broadcasting.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise division with broadcasting.Parameters:
a(Tensor) - Numerator tensorb(Tensor) - Denominator tensor
Add a scalar value to all elements.Parameters:
t(Tensor) - Input tensorscalar(number) - Scalar value to add
Multiply all elements by a scalar value.Parameters:
t(Tensor) - Input tensorscalar(number) - Scalar multiplier
Element-wise negation.Parameters:
t(Tensor) - Input tensor
Element-wise absolute value.Parameters:
t(Tensor) - Input tensor
Element-wise power.Parameters:
base(Tensor) - Base tensorexponent(Tensor) - Exponent tensor
Element-wise square root.Parameters:
t(Tensor) - Input tensor
Element-wise square.Parameters:
t(Tensor) - Input tensor
Element-wise reciprocal (1/x).Parameters:
t(Tensor) - Input tensor
Element-wise sign function (-1, 0, or 1).Parameters:
t(Tensor) - Input tensor
Clip (clamp) tensor values to a range.Parameters:
t(Tensor) - Input tensormin(number) - Minimum valuemax(number) - Maximum value
Element-wise maximum of two tensors.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise minimum of two tensors.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise floor division (rounds toward -Infinity).Parameters:
a(Tensor) - Numerator tensorb(Tensor) - Denominator tensor
Element-wise modulo (remainder has same sign as divisor).Parameters:
a(Tensor) - Dividend tensorb(Tensor) - Divisor tensor
Mathematical Functions
Element-wise exponential (e^x).Parameters:
t(Tensor) - Input tensor
Element-wise base-2 exponential (2^x).Parameters:
t(Tensor) - Input tensor
Element-wise exp(x) - 1, accurate for small x.Parameters:
t(Tensor) - Input tensor
Element-wise natural logarithm.Parameters:
t(Tensor) - Input tensor
Element-wise base-2 logarithm.Parameters:
t(Tensor) - Input tensor
Element-wise base-10 logarithm.Parameters:
t(Tensor) - Input tensor
Element-wise log(1 + x), accurate for small x.Parameters:
t(Tensor) - Input tensor
Element-wise reciprocal square root (1/sqrt(x)).Parameters:
t(Tensor) - Input tensor
Element-wise cube root.Parameters:
t(Tensor) - Input tensor
Element-wise ceiling (round up).Parameters:
t(Tensor) - Input tensor
Element-wise floor (round down).Parameters:
t(Tensor) - Input tensor
Element-wise rounding to nearest integer.Parameters:
t(Tensor) - Input tensor
Element-wise truncation (round toward zero).Parameters:
t(Tensor) - Input tensor
Trigonometric Functions
Element-wise sine.Parameters:
t(Tensor) - Input tensor (radians)
Element-wise cosine.Parameters:
t(Tensor) - Input tensor (radians)
Element-wise tangent.Parameters:
t(Tensor) - Input tensor (radians)
Element-wise arcsine.Parameters:
t(Tensor) - Input tensor
Element-wise arccosine.Parameters:
t(Tensor) - Input tensor
Element-wise arctangent.Parameters:
t(Tensor) - Input tensor
Element-wise two-argument arctangent.Parameters:
y(Tensor) - Y coordinatesx(Tensor) - X coordinates
Element-wise hyperbolic sine.Parameters:
t(Tensor) - Input tensor
Element-wise hyperbolic cosine.Parameters:
t(Tensor) - Input tensor
Element-wise hyperbolic tangent.Parameters:
t(Tensor) - Input tensor
Element-wise inverse hyperbolic sine.Parameters:
t(Tensor) - Input tensor
Element-wise inverse hyperbolic cosine.Parameters:
t(Tensor) - Input tensor
Element-wise inverse hyperbolic tangent.Parameters:
t(Tensor) - Input tensor
Reduction Operations
Sum of tensor elements over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Mean of tensor elements over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Maximum value over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Minimum value over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Product of tensor elements over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Standard deviation over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Variance over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Median value over a given axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Cumulative sum along an axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Axis along which to compute cumulative sum
Cumulative product along an axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Axis along which to compute cumulative product
Logical Operations
Element-wise logical AND.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise logical OR.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise logical NOT.Parameters:
t(Tensor) - Input tensor
Element-wise logical XOR.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Comparison Operations
Element-wise equality comparison.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise inequality comparison.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise greater-than comparison.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise greater-than-or-equal comparison.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise less-than comparison.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise less-than-or-equal comparison.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise approximate equality check.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensorrtol(number) - Relative tolerance (default: 1e-5)atol(number) - Absolute tolerance (default: 1e-8)
Check if all elements are approximately equal.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensorrtol(number) - Relative tolerance (default: 1e-5)atol(number) - Absolute tolerance (default: 1e-8)
Check if all elements are exactly equal.Parameters:
a(Tensor) - First tensorb(Tensor) - Second tensor
Element-wise NaN check.Parameters:
t(Tensor) - Input tensor
Element-wise infinity check.Parameters:
t(Tensor) - Input tensor
Element-wise finite check.Parameters:
t(Tensor) - Input tensor
Test whether all elements are true.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Test whether any element is true.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Optional axis to reduce alongkeepdims(boolean) - Keep reduced dimensions (default: false)
Manipulation Operations
Join tensors along an existing axis.Parameters:
tensors(Tensor[]) - Array of tensors to concatenateaxis(Axis) - Axis along which to join (default: 0)
Join tensors along a new axis.Parameters:
tensors(Tensor[]) - Array of tensors to stackaxis(Axis) - Axis to insert (default: 0)
Split tensor into multiple sub-tensors.Parameters:
t(Tensor) - Input tensorindicesOrSections(number | number[]) - Number of equal sections or split indicesaxis(Axis) - Axis along which to split (default: 0)
Construct a tensor by repeating input.Parameters:
t(Tensor) - Input tensorreps(number | number[]) - Repetitions along each axis
Repeat elements of a tensor.Parameters:
t(Tensor) - Input tensorrepeats(number) - Number of repetitionsaxis(Axis) - Optional axis along which to repeat
Calculate the n-th discrete difference along the given axis.Parameters:
t(Tensor) - Input tensorn(number) - Number of times values are differenced (default: 1)axis(Axis) - Axis along which to compute difference (default: -1)
Sorting
Sort tensor elements along an axis.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Axis to sort along (default: -1)descending(boolean) - Sort in descending order (default: false)
Return indices that would sort a tensor.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Axis to sort along (default: -1)descending(boolean) - Sort in descending order (default: false)
Linear Algebra
Matrix multiplication (dot product).Supports:
- Vector × Vector → scalar
- Matrix × Vector → vector
- Matrix × Matrix → matrix
- Batched operations
a(Tensor) - First tensorb(Tensor) - Second tensor
Activation Functions
Rectified Linear Unit activation.Parameters:
t(Tensor) - Input tensor
Leaky ReLU activation.Parameters:
t(Tensor) - Input tensornegativeSlope(number) - Slope for negative values (default: 0.01)
Sigmoid activation (1 / (1 + exp(-x))).Parameters:
t(Tensor) - Input tensor
Softmax activation.Parameters:
t(Tensor) - Input tensoraxis(Axis) - Axis along which to compute (default: -1)
Log-softmax activation (numerically stable).Parameters:
t(Tensor) - Input tensoraxis(Axis) - Axis along which to compute (default: -1)
Exponential Linear Unit activation.Parameters:
t(Tensor) - Input tensoralpha(number) - Scale for negative values (default: 1.0)
Gaussian Error Linear Unit activation.Parameters:
t(Tensor) - Input tensor
Swish activation (x * sigmoid(x)).Parameters:
t(Tensor) - Input tensor
Mish activation (x * tanh(softplus(x))).Parameters:
t(Tensor) - Input tensor
Softplus activation (log(1 + exp(x))).Parameters:
t(Tensor) - Input tensor
Convolution Helpers
Convert image patches to columns for convolution.Parameters:
input(Tensor) - Input tensor (4D: batch × channels × height × width)kernelSize([number, number]) - Kernel dimensionsstride(number | [number, number]) - Stride (default: 1)padding(number | [number, number]) - Padding (default: 0)
Convert columns back to image patches.Parameters:
cols(Tensor) - Column matrixoutputShape(Shape) - Desired output shapekernelSize([number, number]) - Kernel dimensionsstride(number | [number, number]) - Stride (default: 1)padding(number | [number, number]) - Padding (default: 0)
Random Operations
Generate a dropout mask.Parameters:
shape(Shape) - Mask shaperate(number) - Dropout probability