Is there a PyTorch equivalent to tf.reduce_max()?

If so, would really appreciate it if someone could point me to the definition. Thanks!

How about torch.max?

torch.max(input, dim, keepdim=False, out=None) -> (Tensor, LongTensor)

Returns the maximum value of each row of the input tensor in the given dimension dim.

If the input tensor becomes empty torch.max(), will give an error vs tf.reduce_max will give -inf.

Is there someway we can retain the same behavior as tf.

Example:
torch.max(torch.tensor([]))
RuntimeError: max(): Expected reduction dim to be specified for input.numel() == 0. Specify the reduction dim with the ‘dim’ argument.

tf.reduce_max(tf.constant([]))
<tf.Tensor: shape=(), dtype=float32, numpy=-inf>

Double post from here with follow up.