Are you creating a custom nn module?
def forward(self, x):
    return torch.cat((x, x)) * self.w * x + self.b

If you do something like this, it should be OK. Trying to reuse Linear OTOH, and modifying its weight in-place is not recommended.