code: def train(epoch, reporter):
      model.train()
      for batch_idx, (data, target) in enumerate(train_loader):
          if args.cuda:
              data, target = data.cuda(), target.cuda()
          data, target = Variable(data), Variable(target)
          optimizer.zero_grad()
          output = model(data)
          loss = F.nll_loss(output, target)
          loss.backward()
          optimizer.step()
          reporter.record(batch_idx, loss=loss.data[0])
          reporter.report()
  
file_path: studio/examples/pytorch/mnist.py
imports: from __future__ import print_function
  import argparse
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from torchvision import datasets, transforms
  from torch.autograd import Variable
  import studio
label_desc: Use image node_id 1 for calling a global function with example usage: train(epoch, reporter) without return types