vabh:

optimizer.add_param_group()


I am afraid the result is completely the same as with param_groups.append in my case.
import torch.optim as optim

model = torch.nn.Linear(5, 2)

# Initialize optimizer
optimizer = optim.SGD(model.parameters(), lr=0.001, momentum=0.9)
new = torch.randn(5, 5)
print(new)

optimizer.add_param_group({"params": new})
#optimizer.param_groups.append({'params': new})

print("---")
print(optimizer.param_groups[0])