class_docstr: Gather tensors from all workers with support for backward propagation:
  This implementation does not cut the gradients as torch.distributed.all_gather does.
code: def backward(ctx, *grads):
      all_gradients = torch.stack(grads)
      torch.distributed.all_reduce(all_gradients)
      return all_gradients[torch.distributed.get_rank()]
  
imports: import logging
  import os
  import numpy
  import torch
  import torch.nn
  from lavis.common.dist_utils import download_cached_file, is_dist_avail_and_initialized
  from lavis.common.utils import get_abs_path, is_url
  from omegaconf import OmegaConf
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: all_gradients