code: def train(batch_list, context, network, gluon_trainer, metric):
      """Training with multiple GPUs
  
      Parameters
      ----------
      batch_list: List
        list of dataset
      context: List
        a list of all GPUs to be used for training
      network:
        ResNet
      gluon_trainer:
        rain module of gluon
      """
  
      # Run one forward and backward pass
      def forward_backward(network, data, labels, metric):
          with autograd.record():
              # Compute outputs
              outputs = [network(X) for X in data]
              # Compute the loss
              losses = [
                  loss(yhat, y) for yhat, y in zip(outputs, labels)
              ]
  
          # Run the backward pass (calculate gradients)
          for l in losses:
              l.backward()
  
          metric.update(preds=outputs, labels=labels)
  
      # Use cross entropy loss
      loss = gluon.loss.SoftmaxCrossEntropyLoss()
  
      # Split and load data
      data = batch_list[0]
      data = gluon.utils.split_and_load(data, context)
  
      # Split and load label
      label = batch_list[1]
      label = gluon.utils.split_and_load(label, context)
  
      # Run the forward and backward pass
      forward_backward(network, data, label, metric)
  
      # Update the parameters
      this_batch_size = batch_list[0].shape[0]
      gluon_trainer.step(this_batch_size)
  
file_path: mxnet/example/distributed_training/cifar10_kvstore_hvd.py
imports: import argparse
  import logging
  import time
  import random
  import types
  import warnings
  import numpy
  import mxnet
  from mxnet import autograd, gluon, kv, nd
  from mxnet.gluon.model_zoo import vision
label_desc: Use image node_id 2 for calling a global function with example usage: train(batch_list, context, network, gluon_trainer, metric) without return types