Skip to content
fn

cummin_op

→TensorImplPtr
int cummin_op(const int & a, int axis)

Python wrappers

Public Python APIs implemented by this engine symbol.

Inclusive cumulative minimum along a single axis, yk=min⁡j≤kxjy_k = \min_{j \le k} x_j.

Symmetric to cummax_op: gradient flows only to the position that first achieved the running minimum at each kk.

Math

yk=min⁡j≤kxj,∂L∂xi=∑k≥idyk⋅1[ i=arg⁡min⁡j≤kxj ]. y_k = \min_{j \le k} x_j, \qquad \frac{\partial \mathcal{L}}{\partial x_i} = \sum_{k \ge i} dy_k \cdot \mathbb{1}[\,i = \arg\min_{j \le k} x_j\,].

See Also

cummax_op — symmetric maximum scan.

Parameters

aTensorImplPtr
Input tensor of any non-scalar shape; backward supports F32 / F64.
axisint
Axis along which to accumulate (negative wraps).

Returns

TensorImplPtr

Output tensor of the same shape and dtype as a.