code: def gather_from_all(tensor: torch.Tensor) -> torch.Tensor:
      """
      Similar to classy_vision.generic.distributed_util.gather_from_all
      except that it does not cut the gradients
      """
      if tensor.ndim == 0:
          # 0 dim tensors cannot be gathered. so unsqueeze
          tensor = tensor.unsqueeze(0)
  
      if is_distributed_training_run():
          tensor, orig_device = convert_to_distributed_tensor(tensor)
          gathered_tensors = GatherLayer.apply(tensor)
          gathered_tensors = [
              convert_to_normal_tensor(_tensor, orig_device)
              for _tensor in gathered_tensors
          ]
      else:
          gathered_tensors = [tensor]
      gathered_tensor = torch.cat(gathered_tensors, 0)
      return gathered_tensor
  
file_path: vissl/vissl/utils/distributed_utils.py
imports: from typing import List
  import torch
  import torch.distributed
  from classy_vision.generic.distributed_util import convert_to_distributed_tensor, convert_to_normal_tensor, is_distributed_training_run
label_desc: Use image node_id 1 for calling a global function with example usage: gather_from_all(tensor) and returns: gathered_tensor