Solved by ptrblck in post #2 
              
              
                Both warnings mention a proper fix, so did you try to apply it and was it not working? 
E.g. the first one mentions that the .grad attribute of a non-leaf tensor can be accessed after calling .retain_grad() on this tensor.