Thank you for your code. I ran it. Indeed it doesn’t raise that error, yet it doesn’t train.
Actually, Instead of taking all the changes you suggested, I took my code and changed only the line:
self.translations = torch.stack([x_translation, y_translation], 1)

To:
self.translations = nn.Parameter(torch.stack([x_translation, y_translation], 1))

and indeed the error went away. Yet the gradients w.r.t the original translation tensors remain zero.
I wonder if the constructor nn.Parameter() somehow duplicates the tensor such that the original one is detached from the graph hence no error occur yet neither gradients are back-propagated properly.
I mean, it should be working also without this change, as done in the rotation example in my code.