torch.max — PyTorch 2.12 documentation
Both amax/amin evenly distribute gradients between equal values when there are multiple input elements with the same minimum or maximum value. If reduce over all dimensions(no dim specified), gradients evenly distribute between equally max/min values. If reduce over one specified axis, only propagate to the indexed element. input (Tensor) – the input tensor. out (Tensor, optional) – the output tensor. Example: Returns a namedtuple (values, indices) where values is the maximum value of each row of the input tensor in the given dimension dim. And indices is the index location of each maximum value found (argmax). If keepdim is True, the output tensors are of the same size as input except in the dimension dim where they are of size 1. Otherwise, dim is squeezed (see torch.squeeze()), resulting in the output tensors having 1 fewer dimension than input. Note If there are multiple maximal values in a reduced row then the indices of the first maximal value are returned. input (Tensor) – the i
torch.max # torch. max ( input , * , out = None ) → Tensor # Returns the maximum value of all elements in the input tensor. Note The difference between max / min and amax / amin is: amax / amin supports reducing on multiple dimensions, amax / amin does not return indices. Both amax / amin evenly distribute gradients between equal values when there are multiple input elements with the same minimum or maximum value. For max / min : If reduce over all dimensions(no dim specified), gradients evenly distribute between equally max / min values. If reduce over one specified axis, only propagat
Explore this link on the map →related reading
- numpy.argmax() in Python - GeeksforGeeksgeeksforgeeks.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- torch_geometric.utils - pytorch_geometric documentationpytorch-geometric.readthedocs.io
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- torch.where — PyTorch 2.12 documentationdocs.pytorch.org
- torch.index_select — PyTorch 2.12 documentationdocs.pytorch.org
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- Chapter 0: Fundamentals - ARENAlearn.arena.education
- ReLU — PyTorch 2.12 documentationdocs.pytorch.org
- Computing sharding with einsum : ezyang's blogblog.ezyang.com
- torch.var — PyTorch 2.12 documentationdocs.pytorch.org