code: def all_gather(cls, comm, in_array, out_array, count, stream=None):
      # OutArray is a list
      # This is like gather follow by a broadcast
      # TODO(ecastill), broadcast a single array and split it instead
      # of doing a loop of broadcasts
      # TODO(ecastill) find a way to better determine the root, maybe random?
      # super naive algorithm
      root = 0
      gather_out_arrays = []
      cls.gather(comm, in_array, gather_out_arrays, root, stream)
      if comm.rank != root:
          gather_out_arrays = [
              _make_sparse_empty(
                  in_array.dtype, _get_sparse_type(in_array)
              )
              for _ in range(comm._n_devices)
          ]
      for arr in gather_out_arrays:
          cls.broadcast(comm, arr, root, stream)
          out_array.append(arr)
  
imports: import numpy
  import warnings
  import cupy
  from cupy.cuda import nccl
  from cupyx.distributed import _store
  from cupyx.distributed._comm import _Backend
  from cupyx.scipy import sparse
label_desc: Use image node_id 9 for calling the _SparseNCCLCommunicator obj's underlying member method code with example usage: obj.all_gather(cls, comm, in_array, out_array, count, stream) without return types