code: def train_step(
      model, optimizer, train_loader, data, target, batch_idx, epoch
  ):
      optimizer.zero_grad()
      output = model(data)
      loss = F.nll_loss(output, target)
      loss.backward()
      optimizer.step()
      if batch_idx % 100 == 0:
          print(
              "Train Epoch: {} [{}/{} ({:.0f}%)]\tLoss: {:.6f}".format(
                  epoch,
                  batch_idx * len(data),
                  len(train_loader.dataset),
                  100.0 * batch_idx / len(train_loader),
                  loss.item(),
              )
          )
  
file_path: coremltools/docs/examples/optimize/torch/quantization/linear_quantization.py
imports: from collections import OrderedDict
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import os
  from torchvision import datasets, transforms
  from coremltools.optimize.torch.quantization import LinearQuantizer, LinearQuantizerConfig, ModuleLinearQuantizerConfig
  import coremltools
label_desc: Use image node_id 3 for calling a global function with example usage: train_step(model, optimizer, train_loader, data, target, batch_idx, epoch) without return types