As long as you have followed proper model structure:

your model inherits from the torch.model base class
your model overrides and implements the forward() function

You will be able to just call optim.step() to update all the parameters.