Let me try to answer myself. Found the following post which explains why:

  
      stackoverflow.com
  
  
      
    
  

  RuntimeError occurs in PyTorch backward function 23



  python, tensorflow, pytorch



  
  answered by
  
    Andreas K.
  
  on 09:23AM - 16 Mar 20 UTC