Gradient computation issue due to inplace operation, unsure how to debug for custom model

Hi Sahil!

An inplace modification of a tensor that is in the computation graph does
not necessarily cause an error – it depends on whether the that tensor’s
value is actually used in the backward pass. For some explanation, please
see this post:

From your first post:

inter is also in the computation graph and is also being modified inplace
(assignment to indexed elements). Because cloning inter fixes your inplace
error, modifying inter via indexing was likely the cause of your error.

Best.

K. Frank