class_docstr: Partitioned AR StrategyBuilder.
  
  This StrategyBuilder generates a strategy that partitions each variable along its first dimension,
  and synchronizes them using AllReduce. It might be advantageous for communicating extremely large
  messages -- when synchronizing a single message is bounded by single-flow bandwidth.
  
  It will also sequentially merge collective ops into a single collective group based on chunk_size.
  This strategy does not support synchronizing sparse updates with >1 nodes due to the TF AllGather bug.
docstr: Generate the Strategy.
code: def build(self, graph_item, resource_spec):
      """Generate the Strategy."""
      expr = Strategy()
  
      # data-parallel graph replication first
      expr.graph_config.replicas.extend(
          [k for k, v in resource_spec.gpu_devices]
      )
      for k, v in resource_spec.node_cpu_devices.items():
          if k not in resource_spec.node_gpu_devices:
              expr.graph_config.replicas.extend(v)
  
      # find all variables
      variables = graph_item.trainable_var_op_to_var.values()
  
      # Mark each variable to be synchronized with allreduce
      var_counter = 0
      for var in variables:
          grad = graph_item.var_op_name_to_grad_info[var.op.name][0]
          node_config, num_shards = self._gen_node_config(
              var, var_counter, grad
          )
          var_counter += num_shards
          expr.node_config.append(node_config)
  
      return expr
  
file_path: autodist/autodist/strategy/random_axis_partition_all_reduce_strategy.py
imports: import numpy
  from tensorflow.python.framework.ops import IndexedSlices
  from autodist.kernel.common.utils import get_op_name
  from autodist.kernel.partitioner import PartitionerConfig
  from autodist.proto import strategy_pb2, synchronizers_pb2
  from autodist.strategy.base import Strategy, StrategyBuilder
label_desc: Use image node_id 2 for calling the RandomAxisPartitionAR obj's underlying member method code with example usage: obj.build(graph_item, resource_spec) and returns: expr