powered by
Cummax
(Tensor) the input tensor.
(int) the dimension to do the operation over
(tuple, optional) the result tuple of two output tensors (values, indices)
Returns a namedtuple (values, indices) where values is the cumulative maximum of elements of input in the dimension dim. And indices is the index location of each maximum value found in the dimension dim.
(values, indices)
values
input
dim
indices
$$ y_i = max(x_1, x_2, x_3, \dots, x_i) $$
# NOT RUN { if (torch_is_installed()) { a = torch_randn(c(10)) a torch_cummax(a, dim=1) } # }
Run the code above in your browser using DataLab