pytorch bug: a leaf Variable that requires grad has been used in an in-place operation
pytorch写的好好的代码运行到某一块突然显示a leaf Variable that requires grad has been used in an in-place operation这个bug的意思是 需要梯度的叶子变量被用在了原位操作里指的是 如果是原位操作,就会覆盖原来的值。因为并不是计算过程,是赋值,梯度是多少这个没有一个定义(或许是一个跳变过程,梯度无穷大)。所以...