I’m not familiar with your use case and don’t know how all tensors are calculated.
However, based on the error I guess you might be updating the parameters and trying to reuse an already “stale” forward activation as described in this post 5.