Rate this Page

torch.cummin#

torch.cummin(input, dim, *, out=None)#

Returns a namedtuple (values, indices) where values is the cumulative minimum of elements of input in the dimension dim. And indices is the index ___location of each maximum value found in the dimension dim.

yi=min(x1,x2,x3,,xi)y_i = min(x_1, x_2, x_3, \dots, x_i)
Parameters
  • input (Tensor) – the input tensor.

  • dim (int) – the dimension to do the operation over

Keyword Arguments

out (tuple, optional) – the result tuple of two output tensors (values, indices)

Example:

>>> a = torch.randn(10)
>>> a
tensor([-0.2284, -0.6628,  0.0975,  0.2680, -1.3298, -0.4220, -0.3885,  1.1762,
     0.9165,  1.6684])
>>> torch.cummin(a, dim=0)
torch.return_types.cummin(
    values=tensor([-0.2284, -0.6628, -0.6628, -0.6628, -1.3298, -1.3298, -1.3298, -1.3298,
    -1.3298, -1.3298]),
    indices=tensor([0, 1, 1, 1, 4, 4, 4, 4, 4, 4]))