I solved this issue. The problem is the following function. When we update the next step input (using the output of the current step), we need to update the tensor NOT in-place. Create a new tensor helps.



 ding:

x_input = update_x(output, x, k)