MIght be just me, but I found this kind of hard to follow. Maybe you can make a really simple example, using just like one linear layer or something, and random data (torch.rand), so it’s easy to reproduce?