torch.min¶
- 
torch.min(input) → Tensor¶
- Returns the minimum value of all elements in the - inputtensor.- Warning - This function produces deterministic (sub)gradients unlike - min(dim=0)- Parameters
- input (Tensor) – the input tensor. 
 - Example: - >>> a = torch.randn(1, 3) >>> a tensor([[ 0.6750, 1.0857, 1.7197]]) >>> torch.min(a) tensor(0.6750) - 
torch.min(input, dim, keepdim=False, *, out=None)¶
 - Returns a namedtuple - (values, indices)where- valuesis the minimum value of each row of the- inputtensor in the given dimension- dim. And- indicesis the index location of each minimum value found (argmin).- If - keepdimis- True, the output tensors are of the same size as- inputexcept in the dimension- dimwhere they are of size 1. Otherwise,- dimis squeezed (see- torch.squeeze()), resulting in the output tensors having 1 fewer dimension than- input.- Note - If there are multiple minimal values in a reduced row then the indices of the first minimal value are returned. - Parameters
- Keyword Arguments
- out (tuple, optional) – the tuple of two output tensors (min, min_indices) 
 - Example: - >>> a = torch.randn(4, 4) >>> a tensor([[-0.6248, 1.1334, -1.1899, -0.2803], [-1.4644, -0.2635, -0.3651, 0.6134], [ 0.2457, 0.0384, 1.0128, 0.7015], [-0.1153, 2.9849, 2.1458, 0.5788]]) >>> torch.min(a, 1) torch.return_types.min(values=tensor([-1.1899, -1.4644, 0.0384, -0.1153]), indices=tensor([2, 0, 1, 0])) - 
torch.min(input, other, *, out=None) → Tensor¶
 - See - torch.minimum().