code: def _buildShuffle(self, num_workers, num_gpus, num_shards):
      # Use local CPU for all shuffle shards
      gather_devices = [
          "/replica:0/task:0/device:CPU:0" for _ in range(num_shards)
      ]
      return lambda x, un_op: ar.build_shuffle_all_reduce(
          x, gather_devices, math_ops.add_n, un_op
      )
  
imports: import time
  import numpy
  from tensorflow.core.framework import types_pb2
  from tensorflow.python.distribute.v1 import all_reduce
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 10 for calling the AllReduceTest obj's underlying member method code with example usage: obj._buildShuffle(num_workers, num_gpus, num_shards) and returns: function