code: def all_to_all(cls, comm, in_array, out_array, stream=None):
      # in_array & out_array is a list of sparse matrices
      if len(in_array) != comm._n_devices:
          raise RuntimeError(
              f"all_to_all requires in_array to have {comm._n_devices}"
              f"elements, found {len(in_array)}"
          )
  
      # Exchange metadata
      shape_and_sizes = []
      recv_shape_and_sizes = []
      for i, a in enumerate(in_array):
          arrays = cls._get_internal_arrays(a)
          shape_and_sizes.append(
              cls._get_shape_and_sizes(arrays, a.shape)
          )
  
      recv_shape_and_sizes = cls._exchange_shape_and_sizes(
          comm, i, shape_and_sizes, "alltoall", stream
      )
  
      # prepare the arrays to recv the data
      for i in range(comm._n_devices):
          shape = tuple(recv_shape_and_sizes[i][0:2])
          sizes = recv_shape_and_sizes[i][2:]
          s_arrays = cls._get_internal_arrays(in_array[i])
          # TODO(use the out_array datatypes)
          r_arrays = [
              cupy.empty(s, dtype=a.dtype)
              for s, a in zip(sizes, s_arrays)
          ]
          nccl.groupStart()
          for a in s_arrays:
              cls._send(comm, a, i, a.dtype, a.size, stream)
          for a in r_arrays:
              cls._recv(comm, a, i, a.dtype, a.size, stream)
          nccl.groupEnd()
          out_array.append(
              _make_sparse_empty(
                  in_array[i].dtype, _get_sparse_type(in_array[i])
              )
          )
          cls._assign_arrays(out_array[i], r_arrays, shape)
  
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 17 for calling the _SparseNCCLCommunicator obj's underlying member method code with example usage: obj.all_to_all(cls, comm, in_array, out_array, stream) without return types