code: def main(args):
      # Device config
      device = torch.device(
          f"cuda:{args.cuda}"
          if torch.cuda.is_available() and args.cuda >= 0
          else "cpu"
      )
      # ---------
  
      # --- TRANSFORMATIONS
      train_transform = transforms.Compose(
          [
              Resize(224),
              ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
      test_transform = transforms.Compose(
          [
              Resize(224),
              ToTensor(),
              transforms.Normalize((0.1307,), (0.3081,)),
          ]
      )
      # ---------
  
      # --- BENCHMARK CREATION
      benchmark = SplitCIFAR10(
          5,
          train_transform=train_transform,
          eval_transform=test_transform,
      )
      # ---------
  
      # CREATE THE STRATEGY INSTANCE
      cl_strategy = AR1(criterion=CrossEntropyLoss(), device=device)
  
      # TRAINING LOOP
      print("Starting experiment...")
      results = []
      for experience in benchmark.train_stream:
          print("Start of experience: ", experience.current_experience)
          print(
              "Current Classes: ", experience.classes_in_this_experience
          )
  
          cl_strategy.train(experience, num_workers=0)
          print("Training completed")
  
          print("Computing accuracy on the whole test set")
          results.append(
              cl_strategy.eval(benchmark.test_stream, num_workers=0)
          )
  
file_path: avalanche/examples/ar1.py
imports: import argparse
  import torch
  from torch.nn import CrossEntropyLoss
  from torchvision import transforms
  from torchvision.transforms import ToTensor, Resize
  from avalanche.benchmarks import SplitCIFAR10
  from avalanche.training.supervised.ar1 import AR1
label_desc: Use image node_id 1 for calling a global function with example usage: main(args) without return types