def before_training_exp(
        self,
        strategy: "SupervisedTemplate",
        num_workers: int = 0,
        shuffle: bool = True,
        drop_last: bool = False,
        **kwargs
    ):
        """
        Dataloader to build batches containing examples from both memories and
        the training dataset
        """
        if len(self.storage_policy.buffer) == 0:
            # first experience. We don't use the buffer
            return

        batch_size_mem = self.batch_size_mem
        if batch_size_mem is None:
            batch_size_mem = strategy.train_mb_size

        self.storage_policy.buffer

        self.replay_loader = DataLoader(
            self.storage_policy.buffer,
            batch_size=self.batch_size_mem,
            shuffle=shuffle,
        )

        assert strategy.adapted_dataset is not None
        strategy.dataloader = ReplayDataLoader(
            strategy.adapted_dataset,
            self.storage_policy.buffer,
            oversample_small_tasks=True,
            batch_size=batch_size_mem,
            batch_size_mem=batch_size_mem,
            task_balanced_dataloader=False,
            num_workers=num_workers,
            shuffle=shuffle,
            drop_last=drop_last,
        )

        Dataloader to build batches containing examples from both memories and
        the training dataset
        
avalanche/training/plugins/rar.py