code: def flatten_tensors(tensors: List[torch.Tensor]) -> torch.Tensor:
      """
      Flatten dense tensors into a contiguous 1D buffer. Assume tensors are of
      same dense type.
      Since inputs are dense, the resulting tensor will be a concatenated 1D
      buffer. Element-wise operation on this buffer will be equivalent to
      operating individually
      Args:
          tensors (Iterable[Tensor]): dense tensors to flatten
      Returns:
          A 1D buffer containing input tensors
      """
      if len(tensors) == 1:
          return tensors[0].view(-1).clone()
      flat = torch.cat([t.view(-1) for t in tensors], dim=0)
      return flat
  
file_path: fairscale/fairscale/experimental/nn/data_parallel/gossip/utils/helpers.py
imports: import collections
  import logging
  import sys
  from typing import Any, Dict, List, MutableMapping, Set, Tuple
  import torch
  import torch.distributed
label_desc: Use image node_id 1 for calling a global function with example usage: flatten_tensors(tensors) and returns: flat, tensors