It looks like the .zero_grad() exists in both torch.nn.Module as well as torch.optim.Optimizer. So it will work both the same if all model parameters are passed to the optimizer.
However, there can be some cases where the model parameters are split into two or more gourps and learned via different optimizers. In those cases, calling model.zero_grad() will setthe gradients of all model parameters to zero, whereas optim_a.zero_grad() will clear the gradients of a portion of the parameters.