Amin
Usage
torch_amin(self, dim = list(), keepdim = FALSE)
Note
The difference between max
/min
and amax
/amin
is:
amax
/amin
supports reducing on multiple dimensions,amax
/amin
does not return indices,amax
/amin
evenly distributes gradient between equal values, whilemax(dim)
/min(dim)
propagates gradient only to a single index in the source tensor.
If keepdim
is TRUE
, the output tensors are of the same size as
input
except in the dimension(s) dim
where they are of size 1.
Otherwise, dim
s are squeezed (see torch_squeeze()
), resulting in
the output tensors having fewer dimensions than input
.
amin(input, dim, keepdim=FALSE, *, out=None) -> Tensor
Returns the minimum value of each slice of the input
tensor in the given
dimension(s) dim
.
Examples
if (torch_is_installed()) {
a <- torch_randn(c(4, 4))
a
torch_amin(a, 1)
}
#> torch_tensor
#> 0.6590
#> -0.5597
#> -2.0884
#> -0.3251
#> [ CPUFloatType{4} ]