def model_adaptation(self, model=None):
        """Adapts the model to the current data.

        Calls the :class:`~avalanche.models.DynamicModule`s adaptation.
        """
        if model is None:
            model = self.model

        assert self.experience is not None

        # For training:
        if isinstance(self.experience, OnlineCLExperience) and self.is_training:
            if self.experience.access_task_boundaries:
                avalanche_model_adaptation(model, self.experience.origin_experience)
            else:
                avalanche_model_adaptation(model, self.experience)
        else:
            avalanche_model_adaptation(model, self.experience)

        return model.to(self.device)
Adapts the model to the current data.

        Calls the :class:`~avalanche.models.DynamicModule`s adaptation.
        
avalanche/training/templates/observation_type/batch_observation.py