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 backward(ctx, *grads: torch.Tensor) -> torch.Tensor:
      (input,) = ctx.saved_tensors
      grad_out = torch.empty_like(input)
      grad_out[:] = grads[dist.get_rank()]
      return grad_out
  
file_path: lightly/lightly/utils/dist.py
imports: from typing import Optional, Tuple
  import torch
  import torch.distributed
label_desc: Use image node_id 2 for calling the GatherLayer obj's underlying member method code with example usage: obj.backward(ctx) and returns: grad_out