argmax
tch_argmax(x, dim = NULL, keepdim = FALSE, na.rm = FALSE)
x | tensor object |
---|---|
dim | if NULL (the default) will reduce to a scalar. Otherwise it will
return TRUE if all elements in each row of the tensor in the given dimension
|
keepdim | If keepdim is TRUE, the output tensor is of the same size as
input except in the dimension dim where it is of size 1. Otherwise, dim is
squeezed |
na.rm | won't be used by the function. Only there to be compatible with all generic. |
#> tensor #> (1,.,.) = #> 0.8746 0.4023 #> 0.0342 0.4035 #> #> (2,.,.) = #> 0.1749 0.1957 #> 0.3204 0.0637 #> [ Variable[CPUFloatType]{2,2,2} ]tch_argmax(x)#> tensor #> 0 #> [ Variable[CPULongType]{} ]tch_argmax(x, dim = 0)#> tensor #> 0 0 #> 1 0 #> [ Variable[CPULongType]{2,2} ]tch_argmax(x, dim = 1, keepdim = FALSE)#> tensor #> 0 1 #> 1 0 #> [ Variable[CPULongType]{2,2} ]