code: def all_gather_tensor_inplace(
      output_tensor: torch.Tensor,
      input_tensor: torch.Tensor,
      group,  # TODO add a type,
      async_op: bool = False,
      tag: str = "",
      gather_dim: int = 0,
  ):
      assert (
          not async_op
      ), "Can't remap async version of inplace op to functional collective"
      return output_tensor.copy_(
          all_gather_tensor(input_tensor, gather_dim, group, tag)
      )
  
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 31 for calling a global function with example usage: all_gather_tensor_inplace(output_tensor, input_tensor, group, async_op, tag, gather_dim) and returns: output_tensor