错误:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
分析:新版本的pytorch把 Varible 和Tensor融合为一个Tensor, inplace操作,之前能对Varible 使用,但对Tensor使用就会出错
查看是不是有如下表达
x += res #报错
改为
x = x + res
即可不报错了