Solved by Sudipto in post #3 
              
              
                Hi albanD, 
I figured out the issue yesterday. The inplace operations inside the function IIC_loss created the problem. 
Instead of the original lines, 
p_i_j[(p_i_j < EPS).data] = EPS 
p_j[(p_j < EPS).data] = EPS 
p_i[(p_i < EPS).data] = EPS 
The correct version for new PyTorch (>= 1.3) should be a…