Also is there a reliable way to find out the order of the grad_input tuple? Module — PyTorch 1.9.0 documentation I believe the grad_input tuple for a linear layer is (dy/d_bias, dy/d_input, dy/d_weight) but for other layers, I would like a way to reliable way to map this.
I’m getting conflicting documentation from multiple sources about the arguments that the hook function receives (from third-party documentation).