code: def _multi_tensor_copy(
      buffers_in: List[torch.Tensor],
      buffers_out: List[torch.Tensor],
      dummy_overflow_buf: Optional[torch.Tensor] = None,
  ) -> None:
      """Copy between corresponding buffers
  
      Uses fused copy kernel if possible.
      """
  
      # Group buffers by device and dtype
      buffer_groups = collections.defaultdict(list)
      for buf_in, buf_out in zip(buffers_in, buffers_out):
          if (
              buf_in.data_ptr() == buf_out.data_ptr()
              or buf_in.numel() == 0
          ):
              # Nothing to be done if input and output buffers are same
              # or have no entries
              continue
          if buf_in.dtype == buf_out.dtype:
              # Just copy bytes if dtypes are same
              buf_in = buf_in.view(torch.uint8)
              buf_out = buf_out.view(torch.uint8)
          is_cuda = _devices_match(
              buf_in.device, "cuda"
          ) and _devices_match(buf_out.device, "cuda")
          is_contiguous = (
              buf_in.is_contiguous() and buf_out.is_contiguous()
          )
          key = (
              buf_in.dtype,
              buf_out.dtype,
              is_cuda,
              is_contiguous,
          )
          buffer_groups[key].append((buf_in, buf_out))
  
      # Copy each group of buffers
      for key, buffers in buffer_groups.items():
          # Check if buffers support fused kernel
          dtype_in, dtype_out, is_cuda, is_contiguous = key
          supported_dtypes = (torch.float32, torch.float16)
          use_fused_kernel = (
              dtype_in in supported_dtypes
              and dtype_out in supported_dtypes
          ) or (dtype_in == torch.uint8 and dtype_out == torch.uint8)
          use_fused_kernel = (
              use_fused_kernel and is_cuda and is_contiguous
          )
  
          # Copy buffers
          if use_fused_kernel and _FOUND_DEPRECATED_FUSED_ADAM:
              if dummy_overflow_buf is None:
                  dummy_overflow_buf = torch.zeros(
                      [1], dtype=torch.int32, device="cuda"
                  )
              multi_tensor_applier(
                  fused_adam_cuda.maybe_cast_mt,
                  dummy_overflow_buf,
                  list(zip(*buffers)),
              )
          else:
              for buf_in, buf_out in buffers:
                  buf_out.copy_(buf_in)
  
imports: import collections
  import contextlib
  from dataclasses import dataclass
  import enum
  import inspect
  import io
  import itertools
  import threading
  from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Union
  import warnings
  import torch
  from torch.distributed.distributed_c10d import _get_default_group
  from apex.multi_tensor_apply import multi_tensor_applier
  import amp_C
  import distributed_adam_cuda
  from torch.distributed.distributed_c10d import _coalescing_manager
label_desc: Use image node_id 3 for calling a global function with example usage: _multi_tensor_copy(buffers_in, buffers_out, dummy_overflow_buf) without return types