code: def test_out(test, dtype, device):
      src = tensor(test["src"], dtype, device)
      index = tensor(test["index"], torch.long, device)
      indptr = tensor(test["indptr"], torch.long, device)
      expected = tensor(test["expected"], dtype, device)
  
      size = list(src.size())
      size[index.dim() - 1] = index.size(-1)
      out = src.new_full(size, -2)
  
      gather_csr(src, indptr, out)
      assert torch.all(out == expected)
  
      out.fill_(-2)
  
      gather_coo(src, index, out)
      assert torch.all(out == expected)
  
file_path: pytorch_scatter/test/test_gather.py
imports: from itertools import product
  import pytest
  import torch
  from torch.autograd import gradcheck
  from torch_scatter import gather_coo, gather_csr
  from torch_scatter.testing import devices, dtypes, tensor
label_desc: Use image node_id 3 for calling a global function with example usage: test_out(test, dtype, device) without return types