code: def train(dataloader, model, loss_fn, optimizer):
      size = len(dataloader.dataset)
      model.train()
      for batch, (X, y) in enumerate(dataloader):
          X, y = X.to(device), y.to(device)
          pred = model(X)
          loss = loss_fn(pred, y)
          optimizer.zero_grad()
          loss.backward()
          optimizer.step()
  
file_path: nni/docs/source/tutorials/hpo_quickstart_pytorch/model.py
imports: import nni
  import torch
  from torch import nn
  from torch.utils.data import DataLoader
  from torchvision import datasets
  from torchvision.transforms import ToTensor
label_desc: Use image node_id 1 for calling a global function with example usage: train(dataloader, model, loss_fn, optimizer) without return types