musti76:

new2Probs = F.softmax(newProbs[:,:,0:2], dim=-1) newProbs[:,:,0:2] = new2Probs newProbs[:,:,2] = 0


You can change these three lines as below and try if it works:
only2probs = F.softmax(newProbs[:,:,0:2], dim=-1)
zeros = torch.zeros(only2probs.shape[0], only2probs.shape[1], 1)
newProbs = torch.cat((only2probs, zeros), dim=-1)