You should get a warning, as duplicated parameters will cause an error in the future:
x = nn.Parameter(torch.randn(1))
optimizer = torch.optim.SGD([x, x], lr=1.)
> UserWarning: optimizer contains a parameter group with duplicate parameters; in future, this will cause an error; see github.com/pytorch/pytorch/issues/40967 for more information