I found some similar question

  
    
    
    nn.ReLU(inplace=True) make an error 
  
  
    When I use nn.ReLU(inplace=True), there is an error that is: 
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation

But this error just appears in some places. Why it occurs?
  


So can we always use the out-place version for safety?