Thanks @ptrblck. One more doubt and that is,  once I have my probability probs= torch.tensor([0.5, 0.3, 0.1, 0.1]), I want to keep channel 0 and channel 1 as it these channels have the maximum probability. How do I do the slicing?