报错:
which is output 0 of CudnnRnnBackward0, is at version 1; expected version 0 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
代码
x += residual
会报计算图错误
正确的写法是x = x + residual
原因:底层库没有重载+=,可能只重载了+