code: def test_radius_graph(dtype, device):
      x = tensor(
          [
              [-1, -1],
              [-1, +1],
              [+1, +1],
              [+1, -1],
          ],
          dtype,
          device,
      )
  
      edge_index = radius_graph(x, r=2.5, flow="target_to_source")
      assert to_set(edge_index) == set(
          [
              (0, 1),
              (0, 3),
              (1, 0),
              (1, 2),
              (2, 1),
              (2, 3),
              (3, 0),
              (3, 2),
          ]
      )
  
      edge_index = radius_graph(x, r=2.5, flow="source_to_target")
      assert to_set(edge_index) == set(
          [
              (1, 0),
              (3, 0),
              (0, 1),
              (2, 1),
              (1, 2),
              (3, 2),
              (0, 3),
              (2, 3),
          ]
      )
  
      jit = torch.jit.script(radius_graph)
      edge_index = jit(x, r=2.5, flow="source_to_target")
      assert to_set(edge_index) == set(
          [
              (1, 0),
              (3, 0),
              (0, 1),
              (2, 1),
              (1, 2),
              (3, 2),
              (0, 3),
              (2, 3),
          ]
      )
  
file_path: pytorch_cluster/test/test_radius.py
imports: from itertools import product
  import pytest
  import scipy.spatial
  import torch
  from torch_cluster import radius, radius_graph
  from torch_cluster.testing import devices, grad_dtypes, tensor
label_desc: Use image node_id 3 for calling a global function with example usage: test_radius_graph(dtype, device) without return types