@ToruOwO (Toru) posted a new topic, subject "Is there a PyTorch equivalent to tf.reduce_max()?". It read:

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

After which, @Tony-Y added

    How about torch.max?
    [code] 
        torch.max(input, dim, keepdim=False, out=None) -> (Tensor, LongTensor)
        
    [/code]
    
    Returns the maximum value of each row of the input tensor in the given dimension dim.

So @manoj_batra (manoj batra) replied

    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>

Then @ptrblck said

    Double post from here with follow up.


{'source': 'discourse', 'url': 'https://discuss.pytorch.org/t/is-there-a-pytorch-equivalent-to-tf-reduce-max/35451', 'title': 'Is there a PyTorch equivalent to tf.reduce_max()?', 'views': 5815, 'has_accepted_answer': False, 'word_count': 140, 'like_count': 0, 'reply_count': 2, 'participant_count': 4, 'posts': 4, 'tags': '', 'author': '@ToruOwO (Toru)', 'participants': '@ToruOwO (Toru), @Tony-Y, @manoj_batra (manoj batra), @ptrblck', 'image_url': [None], 'created_at': '2019-01-24T04:03:00.970Z', 'last_posted_at': '2022-08-16T18:42:25.361Z'}