Based on the code 12, it looks like a narrow operation has incorrect arguments. However, it’s strange that this only shows up in your backward pass but not your forward pass, so it could be a bug with pytorch (or with the backward pass, if it was custom defined).