code: def train(model, optimizer, train_loader, device, train_log_interval):
      """This is the training code"""
  
      model.train()
      for batch_idx, (data, target) in enumerate(train_loader):
          data, target = data.to(device), target.to(device)
  
          output = model(data)
          loss = F.cross_entropy(output, target)
  
          optimizer.zero_grad()
          loss.backward()
          if batch_idx == 0:
              tracker.add("model", model)
          optimizer.step()
  
          # **✨ Increment the global step**
          tracker.add_global_step()
          # **✨ Store stats in the tracker**
          tracker.save({"loss.train": loss})
  
          #
          if batch_idx % train_log_interval == 0:
              # **✨ Save added stats**
              tracker.save()
  
file_path: labml/client/test/mnist_tracker.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  import torch.utils.data
  from torchvision import datasets, transforms
  from labml import lab, tracker, experiment, logger
label_desc: Use image node_id 1 for calling a global function with example usage: train(model, optimizer, train_loader, device, train_log_interval) without return types