class_docstr: Gather tensors from all process, supporting backward propagation.
class_docstr_tok: ["Gather","tensors","from","all","process",",","supporting","backward","propagation","."]
code: def backward(ctx, *grads):
      (input,) = ctx.saved_tensors
      grad_out = torch.zeros_like(input)
      grad_out[:] = grads[dist.get_rank()]
      return grad_out
  
imports: import functools
  import logging
  import pickle
  import torch
  import torch.distributed
  from pytorchvideo.layers.distributed import cat_all_gather, get_local_process_group, get_local_rank, get_local_size, get_world_size, init_distributed_training
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