Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.min function

PyTorch torch.min function


PyTorch torch reference manual 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

]

]

)

print

(

"Global minimum:"

,

torch.

min

(

x

)

)

print

(

"dim=0 minimum:"

,

torch.

min

(

x

,

dim

=

0

)

)


PyTorch torch reference manual PyTorch torch reference manual