However, in this epoch
tpmult = x_onehot * y_onehot    #times prediction and gt coincide is 1
tp = torch.sum(torch.sum(torch.sum(tpmult, dim=0, keepdim=True), dim=2, keepdim=True), dim=3, keepdim=True).squeeze()

and x_onehot istensor([ 0.], device='cuda:0'), and y_onehot is tensor([ 1.], device='cuda:0')