bgawrych opened a new pull request #18316: URL: https://github.com/apache/incubator-mxnet/pull/18316
## Description ## Fix for LSTM and GRU layers without DNNL enabled give wrong gradients #17898 For bidiractional LSTM with number of layers > 2 input gradient calculation was incorrect. Reason of wrong calculations was overwriting y derivative (dy) tensor by calculated x derivative (dx) tensor before right2left layer could use dy for own gradient calculations. For GRU with number of layers > 2 i2h_weight gradient for layers in the middle (all except last and first) was incorrect. Wrong caluculations were caused by assigning output pointer to input instead of calculating new input pointer. ## Checklist ## ### Essentials ### - [x] Changes are complete (i.e. I finished coding on this PR) - [x] To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ## Comments ## - This PR is backport of #18203 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org