even after self.weight = nn.Parameter(...), you can change size of self.weight manually if you want.
But it’s still not clear to me how you are changing the size of self.weight. How is self.weight actually computed? (not the shape, but also the value of the elements?)