code: def train(epoch):
      model.train()
      for batch_idx, (data, target) in enumerate(train_loader):
          if args.cuda:
              data, target = data.cuda(), target.cuda()
          optimizer.zero_grad()
          output = model(data)
          loss = F.nll_loss(output, target)
          loss.backward()
          optimizer.step()
          if batch_idx % args.log_interval == 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.data.item(),
                  )
              )
              step = epoch * len(train_loader) + batch_idx
              log_scalar("train_loss", loss.data.item(), step)
  
file_path: BentoML/examples/mlflow/pytorch/mnist.py
imports: import argparse
  import os
  import mlflow
  import mlflow.pytorch
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from torchvision import datasets
  from torchvision import transforms
  import bentoml
label_desc: Use image node_id 1 for calling a global function with example usage: train(epoch) without return types