
Last chance! 50% off unlimited learning
Sale ends in
Argmax
(Tensor) the input tensor.
(int) the dimension to reduce. If NULL
, the argmax of the flattened input is returned.
(bool) whether the output tensor has dim
retained or not. Ignored if dim=NULL
.
Returns the indices of the maximum value of all elements in the input
tensor.
This is the second value returned by torch_max
. See its
documentation for the exact semantics of this method.
Returns the indices of the maximum values of a tensor across a dimension.
This is the second value returned by torch_max
. See its
documentation for the exact semantics of this method.
if (torch_is_installed()) {
if (FALSE) {
a = torch_randn(c(4, 4))
a
torch_argmax(a)
}
a = torch_randn(c(4, 4))
a
torch_argmax(a, dim=1)
}
Run the code above in your browser using DataLab