code: def _local_gather(inp, pos, out_batch_size, maybe_overlap=True):
      inp_buf = torch.zeros(
          out_batch_size,
          inp.shape[-1],
          dtype=inp.dtype,
          device=inp.device,
      )
      if maybe_overlap:
          inp_buf.index_add_(0, pos, inp)
      else:
          inp_buf.index_copy_(0, pos, inp)
      return inp_buf
  
imports: import torch
  from torch.autograd import Function
  import fmoe_cuda
  from .utils import get_torch_default_comm
label_desc: Use image node_id 6 for calling a global function with example usage: _local_gather(inp, pos, out_batch_size, maybe_overlap) and returns: inp_buf