PyTorch torch.min function
PyTorch torch reference manual
torch.min is a function in PyTorch used to compute the minimum value of a tensor.
Function definition
torch.min(input, dim, keepdim, out)
Usage examples
Example
import
torch
x
=
torch.
tensor
(
[
[
1
,
2
,
3
]
,
[
4
,
5
,
6
]
]
)
(
"Global minimum:"
,
torch.
min
(
x
)
)
(
"dim=0 minimum:"
,
torch.
min
(
x
,
dim
=
0
)
)