Palash_Shah:

(since they’re probabilities of class 1 or 2) and then creates a new tensor with the larger one.


You can do this by torch.max
output = torch.randn(1, 2, 64, 64, 64)
output,_ = torch.max(output, 1, keepdim=True)
print(output.shape) # [1, 1, 64, 64, 64]