Hi,
Yes of course.
You can just create all these Tensors and then instead of doing opt.step(), do:
with torch.no_grad():
     params.copy_(new_params)

The torch.no_grad() is important to make sure that this is not recorded in the computational graph !