EML-NOVA · Primitives

What the graphs are made of.

Every library function is composed from these primitives. The last column counts the functions that use each one directly.

PrimitiveWhat it doesInputsDifferentiableUsed by
ConstantA literal value inside the graph.0yes71
AddElementwise sum, NumPy-style broadcasting.2yes52
SubtractElementwise difference, broadcasting.2yes63
MultiplyElementwise product, broadcasting.2yes77
DivideElementwise quotient, broadcasting.2yes33
NegateElementwise negation.1yes16
MatMulMatrix product over the last two axes; leading axes broadcast.2yes20
TransposePermute the axes.1yes14
ReshapeSame elements, new shape; one −1 is inferred.1yes23
ReduceSumSum along one axis, or over everything.1yes29
MeanMean along one axis, or over everything.1yes18
Relumax(x, 0), elementwise.1yes6
Sigmoid1 / (1 + e⁻ˣ), elementwise.1yes1
TanhHyperbolic tangent, elementwise.1yes3
SoftmaxNormalised exponentials along one axis.1yes1
IdentityPass a value through unchanged.1yes—
StopGradientIdentity going forward, zero gradient going back.1yes—
IfChoose between two values by a scalar condition.3not yet—
BoundedLoopA loop with a fixed bound; for now its body is one elementwise operation.1not yet—
CallCall another graph of the same module. This is how the library composes; since Round 13.1, differentiation follows the call into the callee.anyyes45
SqrtSquare root, elementwise; correctly rounded (IEEE 754).1yes11
ExpExponential, elementwise.1yes9
LogNatural logarithm, elementwise.1yes12
MaximumExact elementwise maximum, broadcasting; ties send the gradient to the first operand.2yes8
MinimumExact elementwise minimum, broadcasting; ties send the gradient to the first operand.2yes3
LessElementwise a < b as a 0/1 float mask; zero gradient.2yes4
GreaterElementwise a > b as a 0/1 float mask; zero gradient.2yes11
EqualElementwise a = b as a 0/1 float mask; zero gradient.2yes11
WhereSelect a where the condition is non-zero, else b; all three broadcast.3yes8
ReduceMaxLargest value along one axis, or overall; ties share the gradient equally.1yes8
ReduceMinSmallest value along one axis, or overall; ties share the gradient equally.1yes3
SizeThe element count of a tensor, or the length of one axis, as a value; zero gradient.1yes9
SliceA contiguous window along one axis; negative bounds count from the end. A window outside the axis is refused, not clamped.1yes22
ConcatJoin tensors along one axis.anyyes12
IotaThe positions 0, 1, …, n−1 along one axis, as values shaped to broadcast; zero gradient.1yes12
SortStable sort along one axis, ascending or descending; the gradient follows the permutation back.1yes3
ArgMaxPosition of the first largest value, as a value; zero gradient.1yes1
ArgMinPosition of the first smallest value, as a value; zero gradient.1yes1
CumSumRunning sum along one axis, from the start or from the end.1yes3
CumMaxRunning maximum along one axis; ties keep the earlier position.1yes1
CumMinRunning minimum along one axis; ties keep the earlier position.1yes—
ScanA loop whose body is another graph: carry a value through a sequence, one step per element, and keep every step. Differentiable: the gradient runs the loop backwards.anyyes7
CastConvert between float64 and int64, exactly: a value that is not a whole number, or lies beyond ±2⁵³, is refused, never rounded; zero gradient.1yes5
GatherPick slices along an axis by integer indices (np.take); an index outside the axis is refused. The gradient is scattered back.2yes4
GatherAlongPick one element per position along an axis (np.take_along_axis): per-row labels, orders from another array.2yes1
ScatterAddAdd slices into a base at integer indices along an axis; repeated indices accumulate (np.add.at).3yes3
ArgSortThe stable sorting permutation, as positions (floats, like ArgMax); Cast them to index with them. Zero gradient.1yes3
WhileA loop that runs a body graph while a condition graph says go on, up to a stated maximum number of steps; exceeding it is an error, not a truncated answer. Differentiable: the gradient replays the steps taken.anyyes4
SolveSolve A·x = b by Gaussian elimination with partial pivoting; a singular matrix is refused.2yes3
CholeskyThe lower-triangular L with L·Lᵀ = A for a symmetric positive-definite A (reads A's lower triangle).1yes5
TriangularSolveForward or back substitution with a triangular matrix.2yes4
EighValuesThe eigenvalues of a symmetric matrix, ascending.1yes2
EighVectorsThe unit eigenvectors of a symmetric matrix, each signed so its largest component is positive.1yes1
QROrthogonalThe orthonormal factor Q of A = Q·R (Householder QR) for a matrix with at least as many rows as columns.1yes3
QRTriangularThe upper-triangular factor R of A = Q·R, with a positive diagonal; a matrix without full column rank is refused.1yes2
SVDValuesThe singular values of a matrix, largest first.1yes6
SVDLeftVectorsThe left singular vectors, as columns, each pair signed by its right vector.1yes3
SVDRightVectorsThe right singular vectors, as columns, each signed so its largest component is positive.1yes4
FloorDiv⌊a/b⌋, rounded toward −∞: exact for integers, the floor of the exact quotient for floats; a zero divisor is refused.2yes3
Moda − b·⌊a/b⌋, the remainder with the divisor's sign.2yes9
FFTThe discrete Fourier transform of a complex vector stored as [2, n] (real parts, imaginary parts), unnormalized.1yes4
IFFTThe inverse transform, with its 1/n, so IFFT(FFT(z)) = z.1yes3
ErfThe error function, erf x = (2/√π)·∫₀ˣ e^(−t²) dt.1yes—
ErfcThe complementary error function 1 − erf x, computed directly so the tail keeps its relative accuracy.1yes1
LogGammalog|Γ(x)|; the poles at 0, −1, −2, … are refused. Its gradient is the digamma function.1yes5
Expm1eˣ − 1, accurate near 0 where exp(x) − 1 loses every digit.1yes1
Log1plog(1 + x), accurate near 0 where log(1 + x) would round 1 + x first.1yes4
NdtriThe standard normal quantile Φ⁻¹(p), for 0 < p < 1; computed by NOVA (Acklam, refined by Halley steps).1yes2
GammaIncThe regularized lower incomplete gamma function P(a, x); differentiable in x and in a (∂P/∂a is computed by NOVA, through the same series and continued fraction).2yes3
BetaIncThe regularized incomplete beta function I_x(a, b); differentiable in x, a and b (∂I/∂a and ∂I/∂b are computed by NOVA, through the same continued fraction).3yes3
GammaIncInvThe inverse of P(a, x) in x: the x with P(a, x) = p, for 0 ≤ p < 1; computed by NOVA (Newton on the log tail); differentiable in p and in a (by implicit differentiation).2yes2
BetaIncInvThe inverse of I_x(a, b) in x: the x with I_x(a, b) = p; computed by NOVA (Newton on the log tail, in logit x); differentiable in p, a and b (by implicit differentiation).3yes2