Rate this Page

Function torch ::stable::amax(const torch::stable::Tensor&, int64_t, bool)#

Function Documentation#

inline torch::stable::Tensor torch::stable::amax(const torch::stable::Tensor &self, int64_t dim, bool keepdim = false)#

Stable version of the amax.default op (single dimension).

Computes the maximum value along the specified dimension. If keepdim is true, the output tensor has the same number of dimensions as the input, with the reduced dimension having size 1. Otherwise, the reduced dimension is removed.

Minimum compatible version: PyTorch 2.9.

Parameters:
  • self – The input tensor.

  • dim – The dimension along which to compute the maximum.

  • keepdim – Whether to retain

Returns:

A tensor containing the maximum values along the specified dimension.