code: def run_train(
      train_dataset,
      test_dataset,
      model,
      epochs,
      batch_size,
      use_compile,
      lr,
      lr_decay_factor,
      lr_decay_step_size,
      weight_decay,
  ):
      model = model.to(device)
      if use_compile:
          model = torch.compile(model)
      optimizer = Adam(
          model.parameters(), lr=lr, weight_decay=weight_decay
      )
  
      train_loader = DataLoader(train_dataset, batch_size, shuffle=True)
      test_loader = DataLoader(test_dataset, batch_size, shuffle=False)
  
      for epoch in range(1, epochs + 1):
          if torch.cuda.is_available():
              torch.cuda.synchronize()
          elif (
              hasattr(torch.backends, "mps")
              and torch.backends.mps.is_available()
          ):
              import torch.mps
  
              torch.mps.synchronize()
  
          t_start = time.perf_counter()
  
          train(model, optimizer, train_loader, device)
          test_acc = test(model, test_loader, device)
  
          if torch.cuda.is_available():
              torch.cuda.synchronize()
          elif (
              hasattr(torch.backends, "mps")
              and torch.backends.mps.is_available()
          ):
              import torch.mps
  
              torch.mps.synchronize()
  
          t_end = time.perf_counter()
  
          print(
              f"Epoch: {epoch:03d}, Test: {test_acc:.4f}, "
              f"Duration: {t_end - t_start:.2f}"
          )
  
          if epoch % lr_decay_step_size == 0:
              for param_group in optimizer.param_groups:
                  param_group["lr"] = (
                      lr_decay_factor * param_group["lr"]
                  )
  
file_path: pytorch_geometric/benchmark/points/train_eval.py
imports: import time
  import torch
  import torch.nn.functional
  from torch.optim import Adam
  from torch_geometric.loader import DataLoader
  from torch_geometric.profile import timeit, torch_profile
label_desc: Use image node_id 1 for calling a global function with example usage: run_train(train_dataset, test_dataset, model, epochs, batch_size, use_compile, lr, lr_decay_factor, lr_decay_step_size, weight_decay) without return types