one of the variables needed for gradient computation has been modified by an inplace
参考:https://blog.csdn.net/qq_41997920/article/details/100095961
由于新版本的pytorch把Varible和Tensor融合为一个Tensor,inplace操作,之前对Varible能用,但现在对Tensor,就会出错了。
res += x # 报错
res = x + res