code: def main(args):
      # Config
      device = torch.device(
          f"cuda:{args.cuda}"
          if torch.cuda.is_available() and args.cuda >= 0
          else "cpu"
      )
  
      # Model
      model = SimpleCNN(num_classes=5)
  
      # CL Benchmark Creation
      benchmark = EndlessCLSim(
          scenario=args.scenario,  # "Classes", "Illumination", "Weather"
          sequence_order=None,
          task_order=None,
          semseg=args.semseg,
          dataset_root=args.dataset_root,
      )
  
      train_stream = benchmark.train_stream
      test_stream = benchmark.test_stream
  
      # Prepare for training & testing
      optimizer = Adam(model.parameters(), lr=0.001)
      criterion = CrossEntropyLoss()
  
      # Choose a CL strategy
      strategy = Naive(
          model=model,
          optimizer=optimizer,
          criterion=criterion,
          train_mb_size=64,
          train_epochs=3,
          eval_mb_size=128,
          device=device,
      )
  
      # Train and test loop
      for train_task in train_stream:
          strategy.train(train_task)
          strategy.eval(test_stream)
  
      return
  
file_path: avalanche/examples/endless_cl_sim.py
imports: import argparse
  import torch
  from torch.nn import CrossEntropyLoss
  from torch.optim import Adam
  from avalanche.benchmarks.classic import EndlessCLSim
  from avalanche.models import SimpleCNN
  from avalanche.training.supervised import Naive
label_desc: Use image node_id 1 for calling a global function with example usage: main(args) without return types