Repository: continualai/avalanche
Issue: SplitFMNIST error when enumerating the dataset

On `SplitFMnist` is not possible to loop over the experience dataset.

To reproduce:
```
from avalanche.benchmarks import SplitFMNIST

scenario = SplitFMnist(5)
dataset = scenario.train_stream[0].dataset
for el in dataset:
  pass
```

returns 

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 306, in __getitem__
    return TupleTLabel(manage_advanced_indexing(
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 320, in manage_advanced_indexing
    single_element = single_element_getter(int(single_idx))
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 1035, in _get_single_item
    return self._process_pattern(self._dataset[idx], idx)
  File "/home/cossu/miniconda3/envs/avalanche-env/lib/python3.9/site-packages/torch/utils/data/dataset.py", line 272, in __getitem__
    return self.dataset[self.indices[idx]]
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 306, in __getitem__
    return TupleTLabel(manage_advanced_indexing(
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 320, in manage_advanced_indexing
    single_element = single_element_getter(int(single_idx))
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 659, in _get_single_item
    return self._process_pattern(self._dataset[idx], idx)
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 306, in __getitem__
    return TupleTLabel(manage_advanced_indexing(
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 320, in manage_advanced_indexing
    single_element = single_element_getter(int(single_idx))
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 1035, in _get_single_item
    return self._process_pattern(self._dataset[idx], idx)
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 207, in __getitem__
    result = super().__getitem__(idx)
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 184, in __getitem__
    return self.dataset[self.indices[idx]]
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 306, in __getitem__
    return TupleTLabel(manage_advanced_indexing(
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 320, in manage_advanced_indexing
    single_element = single_element_getter(int(single_idx))
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 659, in _get_single_item
    return self._process_pattern(self._dataset[idx], idx)
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 306, in __getitem__
    return TupleTLabel(manage_advanced_indexing(
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/dataset_utils.py", line 320, in manage_advanced_indexing
    single_element = single_element_getter(int(single_idx))
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 659, in _get_single_item
    return self._process_pattern(self._dataset[idx], idx)
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 669, in _process_pattern
    pattern, label = self._apply_transforms(pattern, label)
  File "/home/cossu/avalanche/avalanche/benchmarks/utils/avalanche_dataset.py", line 680, in _apply_transforms
    pattern = self.transform(pattern)
  File "/home/cossu/miniconda3/envs/avalanche-env/lib/python3.9/site-packages/torchvision/transforms/transforms.py", line 67, in __call__
    img = t(img)
  File "/home/cossu/miniconda3/envs/avalanche-env/lib/python3.9/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/cossu/miniconda3/envs/avalanche-env/lib/python3.9/site-packages/torchvision/transforms/transforms.py", line 226, in forward
    return F.normalize(tensor, self.mean, self.std, self.inplace)
  File "/home/cossu/miniconda3/envs/avalanche-env/lib/python3.9/site-packages/torchvision/transforms/functional.py", line 284, in normalize
    tensor.sub_(mean).div_(std)
RuntimeError: output with shape [1, 32, 32] doesn't match the broadcast shape [3, 32, 32]
```


Changed files:
avalanche/benchmarks/classic/cfashion_mnist.py

diff --git a/avalanche/benchmarks/classic/cfashion_mnist.py b/avalanche/benchmarks/classic/cfashion_mnist.py
index a4beb833..a993f388 100644
--- a/avalanche/benchmarks/classic/cfashion_mnist.py
+++ b/avalanche/benchmarks/classic/cfashion_mnist.py
@@ -20,18 +20,14 @@ from torchvision import transforms
 from avalanche.benchmarks import nc_scenario
 from avalanche.benchmarks.utils import train_eval_avalanche_datasets
 
-_default_cifar10_train_transform = transforms.Compose([
-    transforms.RandomCrop(32, padding=4),
-    transforms.RandomHorizontalFlip(),
+_default_fmnist_train_transform = transforms.Compose([
     transforms.ToTensor(),
-    transforms.Normalize((0.4914, 0.4822, 0.4465),
-                         (0.2023, 0.1994, 0.2010))
+    transforms.Normalize((0.2190,), (0.3318,))
 ])
 
-_default_cifar10_eval_transform = transforms.Compose([
+_default_fmnist_eval_transform = transforms.Compose([
     transforms.ToTensor(),
-    transforms.Normalize((0.4914, 0.4822, 0.4465),
-                         (0.2023, 0.1994, 0.2010))
+    transforms.Normalize((0.2190,), (0.3318,))
 ])
 
 
@@ -40,8 +36,8 @@ def SplitFMNIST(n_experiences: int,
                 return_task_id=False,
                 seed: Optional[int] = None,
                 fixed_class_order: Optional[Sequence[int]] = None,
-                train_transform=_default_cifar10_train_transform,
-                eval_transform=_default_cifar10_eval_transform):
+                train_transform=_default_fmnist_train_transform,
+                eval_transform=_default_fmnist_eval_transform):
     """
     Creates a CL scenario using the Fashion MNIST dataset.
 
@@ -104,13 +100,13 @@ def SplitFMNIST(n_experiences: int,
     :returns: A properly initialized :class:`NCScenario` instance.
     """
 
-    cifar_train, cifar_test = _get_fmnist_dataset(
+    fmnist_train, fmnist_test = _get_fmnist_dataset(
         train_transform, eval_transform)
 
     if return_task_id:
         return nc_scenario(
-            train_dataset=cifar_train,
-            test_dataset=cifar_test,
+            train_dataset=fmnist_train,
+            test_dataset=fmnist_test,
             n_experiences=n_experiences,
             task_labels=True,
             seed=seed,
@@ -118,8 +114,8 @@ def SplitFMNIST(n_experiences: int,
             per_exp_classes={0: 5} if first_batch_with_half_classes else None)
     else:
         return nc_scenario(
-            train_dataset=cifar_train,
-            test_dataset=cifar_test,
+            train_dataset=fmnist_train,
+            test_dataset=fmnist_test,
             n_experiences=n_experiences,
             task_labels=False,
             seed=seed,