class_docstr: Gather tensors from all processes, supporting backward propagation.
  
  This code was taken and adapted from here:
  https://github.com/Spijkervet/SimCLR
class_docstr_tok: ["Gather","tensors","from","all","processes",",","supporting","backward","propagation",".","This","code","was","taken","and","adapted","from","here",":","https",":","\/\/github.com\/Spijkervet\/SimCLR"]
code: def forward(ctx, input: torch.Tensor) -> Tuple[torch.Tensor, ...]:
      ctx.save_for_backward(input)
      output = [
          torch.empty_like(input) for _ in range(dist.get_world_size())
      ]
      dist.all_gather(output, input)
      return tuple(output)
  
file_path: lightly/lightly/utils/dist.py
imports: from typing import Optional, Tuple
  import torch
  import torch.distributed
label_desc: Use image node_id 1 for calling the GatherLayer obj's underlying member method code with example usage: obj.forward(ctx, input) and returns: tuple