code: def test_torch_compile(device):
      x = torch.randn(10, 16, device=device)
      edge_index = torch.randint(0, x.size(0), (2, 40), device=device)
      edge_weight = torch.rand(edge_index.size(1), device=device)
      matrix = torch.randn(x.size(-1), x.size(-1), device=device)
  
      expected = gather_scatter(x, edge_index)
      compiled_op = torch.compile(gather_scatter)
      out = compiled_op(x, edge_index)
      assert torch.allclose(out, expected, atol=1e-6)
  
      expected = gather_cat_scatter(x, edge_index)
      compiled_op = torch.compile(gather_cat_scatter)
      out = compiled_op(x, edge_index)
      assert torch.allclose(out, expected, atol=1e-6)
  
      expected = gather_weight_scatter(x, edge_index, edge_weight)
      compiled_op = torch.compile(gather_weight_scatter)
      out = compiled_op(x, edge_index, edge_weight)
      assert torch.allclose(out, expected, atol=1e-6)
  
      expected = gather_transform_scatter(x, edge_index, matrix)
      compiled_op = torch.compile(gather_transform_scatter)
      out = compiled_op(x, edge_index, matrix)
      assert torch.allclose(out, expected, atol=1e-6)
  
      expected = fused_gather_scatter(x, edge_index)
      compiled_op = torch.compile(fused_gather_scatter)
      out = compiled_op(x, edge_index)
      assert torch.allclose(out, expected, atol=1e-6)
  
file_path: pytorch_geometric/test/nn/test_compile_basic.py
imports: import torch
  from torch_geometric.profile import benchmark
  from torch_geometric.testing import onlyFullTest, onlyLinux, withCUDA, withPackage
  from torch_geometric.utils import scatter
label_desc: Use image node_id 6 for calling a global function with example usage: test_torch_compile(device) without return types