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
  
imports: from singa import singa_wrap
  from singa import autograd
  from singa import tensor
  from singa import device
  from singa import opt
  from PIL import Image
  import numpy
  import os
  import sys
  import time
label_desc: Use image node_id 10 for calling a global function with example usage: reduce_variable(variable, dist_opt, reducer) and returns: output