def freeze_params(model: nn.Module):
    """Set requires_grad=False for each of model.parameters()"""
    for par in model.parameters():
        par.requires_grad = False
Set requires_grad=False for each of model.parameters()
dpkd/transformers/examples/legacy/seq2seq/utils.py