def add_param_group(self, param_group):
        r"""Add a param group to the :class:`Optimizer` s `param_groups`.

            This can be useful when fine tuning a pre-trained network as frozen layers can be made
            trainable and added to the :class:`Optimizer` as training progresses.

            Arguments:
                param_group (dict): Specifies what Tensors should be optimized along with group
                specific optimization options.
            """
        assert isinstance(param_group, dict), "param group must be a dict"

        params = param_group["params"]
        if isinstance(params, torch.Tensor):
            param_group["params"] = [params]
        elif isinstance(params, set):
            raise TypeError(
                "optimizer parameters need to be organized in ordered collections, but "
                "the ordering of tensors in sets will change between runs. Please use a list instead."
            )
        else:
            param_group["params"] = list(params)

        for param in param_group["params"]:
            if not isinstance(param, torch.Tensor):
                raise TypeError(
                    "optimizer can only optimize Tensors, "
                    "but one of the params is " + torch.typename(param)
                )
            if not param.is_leaf:
                raise ValueError("can't optimize a non-leaf Tensor")

        for name, default in self.defaults.items():
            if default is required and name not in param_group:
                raise ValueError(
                    "parameter group didn't specify a value of required optimization parameter "
                    + name
                )
            else:
                param_group.setdefault(name, default)

        param_set = set()
        for group in self.param_groups:
            param_set.update(set(group["params"]))

        if not param_set.isdisjoint(set(param_group["params"])):
            raise ValueError("some parameters appear in more than one parameter group")

        self.param_groups.append(param_group)
Add a param group to the :class:`Optimizer` s `param_groups`.

            This can be useful when fine tuning a pre-trained network as frozen layers can be made
            trainable and added to the :class:`Optimizer` as training progresses.

            Arguments:
                param_group (dict): Specifies what Tensors should be optimized along with group
                specific optimization options.
            
utils_nlp/models/transformers/bertsum/optimizers.py