I didn’t look at the maths in depth. But if you are wondering if using the same module twice will be problematic for pytorch, the answer is no. The autograd engine will properly handle all relevant variables and keep things correct.