code: def build_scenario(mnist=False):
      if not mnist:
          # Fake benchmark is (1,1,6)
          # Data needs to be transformed for AlexNet
          # Repeat the "channel" as AlexNet expects 3 channel input
          # Resize to 227 because AlexNet convolution will reduce the data shape
          CustomDataAlexTransform = transforms.Compose(
              [
                  transforms.Lambda(lambda x: x.repeat(3, 1, 1)),
                  transforms.Resize((227, 227)),
              ]
          )
  
          scenario = get_custom_benchmark(
              use_task_labels=True,
              train_transform=CustomDataAlexTransform,
              eval_transform=CustomDataAlexTransform,
              shuffle=False,
          )
      else:
          # More resource intensive example
          MNISTAlexTransform = transforms.Compose(
              [
                  transforms.Resize((227, 227)),
                  transforms.Lambda(lambda x: x.repeat(3, 1, 1)),
              ]
          )
  
          # Note: Must provide task ID for training
          scenario = SplitMNIST(
              n_experiences=5,
              return_task_id=True,
              train_transform=MNISTAlexTransform,
              eval_transform=MNISTAlexTransform,
          )
  
      return scenario
  
file_path: avalanche/examples/expert_gate.py
imports: import torch
  import argparse
  from torch.utils.data import DataLoader
  from torch.utils.data import TensorDataset
  from torchvision import transforms
  from torch.optim import SGD
  from sklearn.datasets import make_classification
  from sklearn.model_selection import train_test_split
  from avalanche.models import ExpertGate
  from avalanche.benchmarks.classic import SplitMNIST
  from avalanche.training.supervised import ExpertGateStrategy
  from avalanche.models.utils import avalanche_model_adaptation
  from avalanche.benchmarks import nc_benchmark
label_desc: Use image node_id 2 for calling a global function with example usage: build_scenario(mnist) and returns: scenario