Thank you, indeed passing optim.SGD or more simply, calling
x = torch.nn.Parameter(torch.tensor([-1.5,1.5], dtype=torch.float, requires_grad=True))
optimizer = torch.optim.SGD([x], lr=lr, momentum=0.1, nesterov=True)

and removing .clone(), instead of calling it with
x = (-1.5,1.5)
optimizer = torch.optim.SGD([torch.tensor([])], lr=lr, momentum=0.1, nesterov=True)

and setting the parameter manually, worked.
Even a more simple solution worked, which is removing .clone() and removing rosenbrock_test_params and directly setting the parameter with
optimizer.param_groups[0]['params'] = [torch.nn.Parameter(torch.tensor(x, dtype=torch.float, requires_grad=True))]

So, it looks like passing a reference is causing the need to clone. I don’t understand why though.
Any idea about that, or do you think that it’s still an implementation detail depending on the optimizer?