code: def all_to_all_single(
      self: torch.Tensor,
      output_split_sizes: Optional[List[int]],
      input_split_sizes: Optional[List[int]],
      group: RANK_TYPES,
      tag: str = "",
  ) -> torch.Tensor:
      """
      Each process splits input tensor and then scatters the split list
      to all processes in a group. Then concatenate the received tensors from all
      the processes in the group and return single output tensor.
  
      Group can be one of:
          List[int]: ranks participating in the collective.
          List[List[int]]: 2D mesh of ranks taking part of this collective in MPMD.
          ProcessGroup: Will perform a collective using the ranks and tag of the PG.
          DeviceMesh: Do a SPMD collective over all ranks of the mesh
          (DeviceMesh, int): Do a MPMD collective over one dimension of the DeviceMesh
  
      :: N.B. If you pass a PG or a 1D list to perform a MPMD collective, the compiler won't be able to recover
      that information and perform collective algebraic optimization. Use other forms of input for that.
      """
      if output_split_sizes is not None:
          assert all(
              isinstance(size, (int, torch.SymInt))
              for size in output_split_sizes
          ), output_split_sizes
      if input_split_sizes is not None:
          assert all(
              isinstance(size, (int, torch.SymInt))
              for size in input_split_sizes
          ), input_split_sizes
      tag, rankset, group_size = _expand_group(group, tag)
      tensor = torch.ops.c10d_functional.all_to_all_single(self, output_split_sizes, input_split_sizes, tag, rankset, group_size)  # type: ignore[attr-defined]
      return _maybe_wrap_tensor(tensor)
  
imports: import sys
  import warnings
  from typing import cast, List, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  import torch.distributed
  import torch.distributed.distributed_c10d
  from torch._custom_ops import impl_abstract
  from torch.distributed.device_mesh import DeviceMesh
  from torch.fx.experimental.proxy_tensor import get_innermost_proxy_mode
  from .None import _functional_collectives_impl
  from ._functional_collectives_impl import _register_tensor_wrapper
  from torch.distributed.distributed_c10d import all_gather_into_tensor, all_reduce, reduce_scatter_tensor
label_desc: Use image node_id 10 for calling a global function with example usage: all_to_all_single(output_split_sizes, input_split_sizes, group, tag) and returns: _maybe_wrap_tensor