parameters: (input: Tensor,
           dim: DimOrDims = None,
           *,
           keepdim: Optional[bool] = False,
           dtype: Optional[DType] = None,
           mask: Optional[Tensor] = None)
docstring: \
  {reduction_signature}
  
  {reduction_descr}
  
  {reduction_identity_dtype}
  
  {reduction_args}
  
  {reduction_example}
docstring_summary: \
  {reduction_signature}
docstring_tokens: \ { reduction_signature }
function: def amax(input: Tensor,
           dim: DimOrDims = None,
           *,
           keepdim: Optional[bool] = False,
           dtype: Optional[DType] = None,
           mask: Optional[Tensor] = None) -> Tensor:
      """\
  {reduction_signature}
  
  {reduction_descr}
  
  {reduction_identity_dtype}
  
  {reduction_args}
  
  {reduction_example}"""
      if dtype is None:
          dtype = input.dtype
      if input.layout == torch.strided:
          if mask is None:
              mask_input = input
          else:
              identity = input.new_full([], _reduction_identity('amax', input))
              mask_input = torch.where(mask, input, identity)
          dim_ = _canonical_dim(dim, mask_input.ndim)
          return torch.amax(mask_input, dim_, bool(keepdim)).to(dtype=dtype)
      else:
          raise ValueError(f'masked amax expects strided tensor (got {input.layout} tensor)')
function_tokens: def amax ( input : Tensor , dim : DimOrDims = None , * , keepdim : Optional [ bool ] = False , dtype : Optional [ DType ] = None , mask : Optional [ Tensor ] = None ) -> Tensor : if dtype is None : dtype = input . dtype if input . layout == torch . strided : if mask is None : mask_input = input else : identity = input . new_full ( [ ] , _reduction_identity ( 'amax' , input ) ) mask_input = torch . where ( mask , input , identity ) dim_ = _canonical_dim ( dim , mask_input . ndim ) return torch . amax ( mask_input , dim_ , bool ( keepdim ) ) . to ( dtype = dtype ) else : raise ValueError ( f'masked amax expects strided tensor (got {input.layout} tensor)' )