code: def test_fps(dtype, device):
      x = tensor(
          [
              [-1, -1],
              [-1, +1],
              [+1, +1],
              [+1, -1],
              [-2, -2],
              [-2, +2],
              [+2, +2],
              [+2, -2],
          ],
          dtype,
          device,
      )
      batch = tensor([0, 0, 0, 0, 1, 1, 1, 1], torch.long, device)
      ptr_list = [0, 4, 8]
      ptr = torch.tensor(ptr_list, device=device)
  
      out = fps(x, batch, random_start=False)
      assert out.tolist() == [0, 2, 4, 6]
  
      out = fps(x, batch, ratio=0.5, random_start=False)
      assert out.tolist() == [0, 2, 4, 6]
  
      ratio = torch.tensor(0.5, device=device)
      out = fps(x, batch, ratio=ratio, random_start=False)
      assert out.tolist() == [0, 2, 4, 6]
  
      out = fps(x, ptr=ptr_list, ratio=0.5, random_start=False)
      assert out.tolist() == [0, 2, 4, 6]
  
      out = fps(x, ptr=ptr, ratio=0.5, random_start=False)
      assert out.tolist() == [0, 2, 4, 6]
  
      ratio = torch.tensor([0.5, 0.5], device=device)
      out = fps(x, batch, ratio=ratio, random_start=False)
      assert out.tolist() == [0, 2, 4, 6]
  
      out = fps(x, random_start=False)
      assert out.sort()[0].tolist() == [0, 5, 6, 7]
  
      out = fps(x, ratio=0.5, random_start=False)
      assert out.sort()[0].tolist() == [0, 5, 6, 7]
  
      out = fps(
          x, ratio=torch.tensor(0.5, device=device), random_start=False
      )
      assert out.sort()[0].tolist() == [0, 5, 6, 7]
  
      out = fps(
          x,
          ratio=torch.tensor([0.5], device=device),
          random_start=False,
      )
      assert out.sort()[0].tolist() == [0, 5, 6, 7]
  
      out = fps2(x, torch.tensor([0.5], device=device))
      assert out.sort()[0].tolist() == [0, 5, 6, 7]
  
file_path: pytorch_cluster/test/test_fps.py
imports: from itertools import product
  import pytest
  import torch
  from torch import Tensor
  from torch_cluster import fps
  from torch_cluster.testing import devices, grad_dtypes, tensor
label_desc: Use image node_id 2 for calling a global function with example usage: test_fps(dtype, device) without return types