code: def reduce_variable(variable, dist_opt, reducer):
      reducer.copy_from_numpy(variable)
      dist_opt.all_reduce(reducer.data)
      dist_opt.wait()
      output = tensor.to_numpy(reducer)
      return output
  
file_path: singa/examples/largedataset_cnn/train_largedata.py
imports: from singa import singa_wrap
  from singa import device
  from singa import tensor
  from singa import opt
  import numpy
  import time
  import argparse
  from PIL import Image
  import process_data
label_desc: Use image node_id 4 for calling a global function with example usage: reduce_variable(variable, dist_opt, reducer) and returns: output