an inplace operation

Phuc_Tan: <p>RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [512, 1024]], which is output 0 of TBackward, is at version 4; expected version 3 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!<code>Preformatted text</code><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/0/10c900218216fd8d4f9a134ddd96f81bb1386879.png" data-download-href="https://discuss.pytorch.org/uploads/default/10c900218216fd8d4f9a134ddd96f81bb1386879" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/10c900218216fd8d4f9a134ddd96f81bb1386879_2_690x223.png" alt="image" data-base62-sha1="2ouhqGHTtFGkX15XOqkAqabaPBn" width="690" height="223" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/10c900218216fd8d4f9a134ddd96f81bb1386879_2_690x223.png, https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/10c900218216fd8d4f9a134ddd96f81bb1386879_2_1035x334.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/1/0/10c900218216fd8d4f9a134ddd96f81bb1386879_2_1380x446.png 2x" data-dominant-color="3E3F40"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1809×585 70.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/5/c/5c32a3c00b155fe67772c23e072194b87f1f9dc4.png" data-download-href="https://discuss.pytorch.org/uploads/default/5c32a3c00b155fe67772c23e072194b87f1f9dc4" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/5/c/5c32a3c00b155fe67772c23e072194b87f1f9dc4_2_690x333.png" alt="image" data-base62-sha1="d9Cqb31wHv01PNnQZkbqkmpfTDu" width="690" height="333" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/5/c/5c32a3c00b155fe67772c23e072194b87f1f9dc4_2_690x333.png, https://discuss.pytorch.org/uploads/default/optimized/3X/5/c/5c32a3c00b155fe67772c23e072194b87f1f9dc4_2_1035x499.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/5/c/5c32a3c00b155fe67772c23e072194b87f1f9dc4_2_1380x666.png 2x" data-dominant-color="252625"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1920×928 62.1 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

albanD: <p>Have you enabled anomaly mode as suggested in the message? What is the second strack trace that it shows?</p>

Phuc_Tan: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/a/3/a3fe71bb1d59334ca8e9c736cea3b62261979cc0.png" data-download-href="https://discuss.pytorch.org/uploads/default/a3fe71bb1d59334ca8e9c736cea3b62261979cc0" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/a/3/a3fe71bb1d59334ca8e9c736cea3b62261979cc0_2_690x291.png" alt="image" data-base62-sha1="noKYgmAzudUePXKdwq4aY0pfGVO" width="690" height="291" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/a/3/a3fe71bb1d59334ca8e9c736cea3b62261979cc0_2_690x291.png, https://discuss.pytorch.org/uploads/default/optimized/3X/a/3/a3fe71bb1d59334ca8e9c736cea3b62261979cc0_2_1035x436.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/a/3/a3fe71bb1d59334ca8e9c736cea3b62261979cc0_2_1380x582.png 2x" data-dominant-color="3C3D3E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1809×764 88.2 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
I have enable anomaly, here is second stack trace. I implement Feedback Transformer and catch this error.</p>