code: def byteps_push_pull(
      tensor, version=0, priority=0, name=None, is_average=True
  ):
      """
      A function that performs pushing and pulling tensors
  
      The operation is keyed by the name. If name is not provided, an
      incremented auto-generated name is used. The tensor type and shape must be
      the same on all BytePS processes for a given name. The reduction will not
      start until all processes are ready to send and receive the tensor.
  
      This acts as a thin wrapper around an autograd function.  If your input
      tensor requires tensors, then callings this function will allow tensors
      to be computed and backpropagated.
  
      Arguments:
          tensor: A tensor to average and sum.
          average: A flag indicating whether to compute average or summation,
                   defaults to average.
          name: A name of the reduction operation.
  
      Returns:
          None
      """
  
      c_in = tensor.handle
      if isinstance(name, string_types):
          check_call(
              MXNET_LIB_CTYPES.byteps_mxnet_push_pull_async(
                  c_in,
                  c_str(name),
                  ctypes.c_int(version),
                  ctypes.c_int(priority),
                  ctypes.c_bool(is_average),
              )
          )
      else:
          check_call(
              MXNET_LIB_CTYPES.byteps_mxnet_push_pull_async(
                  c_in,
                  name,
                  ctypes.c_int(version),
                  ctypes.c_int(priority),
                  ctypes.c_bool(is_average),
              )
          )
  
      return
  
file_path: byteps/byteps/mxnet/ops.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import ctypes
  import os
  import warnings
  import mxnet
  from mxnet.base import c_str, check_call, string_types
  from byteps.common import get_ext_suffix
  from byteps.common import BytePSBasics
label_desc: Use image node_id 1 for calling a global function with example usage: byteps_push_pull(tensor, version, priority, name, is_average) without return types