def adaptation(self, experience: CLExperience):
        """Training adaptation for PNN layer.

        Adds an additional column to the layer.

        :param dataset:
        :return:
        """
        super().adaptation(experience)
        dataset = experience.dataset
        task_labels = dataset.targets_task_labels
        if isinstance(task_labels, ConstantSequence):
            # task label is unique. Don't check duplicates.
            task_labels = [task_labels[0]]
        else:
            task_labels = set(task_labels)
        assert len(task_labels) == 1, (
            "PNN assumes a single task for each experience. Please use a "
            "compatible benchmark."
        )
        # extract task label from set
        task_label = next(iter(task_labels))
        if task_label in self.task_to_module_idx:
            return  # we already added the column for the current task.

        if len(self.task_to_module_idx) == 0:
            # we have already initialized the first column.
            # No need to call add_column here.
            self.task_to_module_idx[task_label] = 0
        else:
            self.task_to_module_idx[task_label] = self.num_columns
            self._add_column()
Training adaptation for PNN layer.

        Adds an additional column to the layer.

        :param dataset:
        :return:
        
avalanche/models/pnn.py