Hi, @ptrblck
Thanks for your reply. However, I want to calculate the minimum and maximum element along with both height and width dimension.
For example, we have a tensor a=[[1,2],[3,4]], the min/max element should be 1 and 4
a = torch.Tensor([[1,2],[3,4]])
torch.min(a)  # this function will return 1
torch.max(a) # return 4

I have tried your solution, it gives a vector.
a = torch.Tensor([[1,2],[3,4]])
a.min(1, keepdim=True)[0] # this gives [1, 2]
a.max(1, keepdim=True)[0] # this gives [3, 4]