code: def train(model, optimizer, train_loader, device, train_log_interval):
      """This is the training code"""
  
      model.train()
      for batch_idx, (data, target) in monit.enum(
          "Train", train_loader
      ):
          data, target = data.to(device), target.to(device)
  
          optimizer.zero_grad()
          output = model(data)
          loss = F.cross_entropy(output, target)
          loss.backward()
          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/helpers/labml_helpers/datasets/remote/test/mnist_train_normal.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, monit, 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