def test_optimizer_groups_manual_addition(self):
        """
        Tests the manual addition of a new parameter group
        mixed with existing MultiHeadClassifier
        """
        model, criterion, benchmark = self.init_scenario(multi_task=True)

        g1 = []
        g2 = []
        for n, p in model.named_parameters():
            if "classifier" in n:
                g1.append(p)
            else:
                g2.append(p)

        optimizer = SGD([{"params": g1, "lr": 0.1}, {"params": g2, "lr": 0.05}])

        strategy = Naive(
            model=model,
            optimizer=optimizer,
            criterion=criterion,
            train_mb_size=64,
            device=self.device,
            eval_mb_size=50,
            train_epochs=2,
        )

        experience_0 = benchmark.train_stream[0]
        experience_1 = benchmark.train_stream[1]

        strategy.train(experience_0)

        # Add some new parameter and assign it manually to param group
        model.new_module1 = torch.nn.Linear(10, 10)
        model.new_module2 = torch.nn.Linear(10, 10)
        strategy.optimizer.param_groups[1]["params"] += list(
            model.new_module1.parameters()
        )
        strategy.optimizer.add_param_group(
            {"params": list(model.new_module2.parameters()), "lr": 0.001}
        )

        # Also add one but to a new param group

        strategy.train(experience_1)

        for n, p in model.named_parameters():
            assert self._is_param_in_optimizer(p, strategy.optimizer)
            if "classifier" in n:
                self.assertEqual(
                    self._is_param_in_optimizer_group(p, strategy.optimizer), 0
                )
            elif "new_module2" in n:
                self.assertEqual(
                    self._is_param_in_optimizer_group(p, strategy.optimizer), 2
                )
            else:
                self.assertEqual(
                    self._is_param_in_optimizer_group(p, strategy.optimizer), 1
                )

        Tests the manual addition of a new parameter group
        mixed with existing MultiHeadClassifier
        
tests/test_optimizer.py