code: def test_permed_lsdds(permed_lsdds_params):
      n, m, d, B, n_kcs = permed_lsdds_params
  
      kcs = torch.randn(n_kcs, d)
      x_ref = torch.randn(n, d)
      x_cur = 10 + 0.2 * torch.randn(m, d)
      x_full = torch.cat([x_ref, x_cur], axis=0)
      sigma = torch.tensor((1.0,))
      k_all_c = GaussianRBF(sigma)(x_full, kcs)
      H = GaussianRBF(np.sqrt(2.0) * sigma)(kcs, kcs)
  
      perms = [torch.randperm(n + m) for _ in range(B)]
      x_perms = [perm[:n] for perm in perms]
      y_perms = [perm[n:] for perm in perms]
  
      lsdd_perms, H_lam_inv, lsdd_unpermed = permed_lsdds(
          k_all_c, x_perms, y_perms, H, return_unpermed=True
      )
  
      assert int((lsdd_perms > lsdd_unpermed).sum()) == 0
      assert H_lam_inv.shape == (n_kcs, n_kcs)
  
file_path: alibi-detect/alibi_detect/utils/pytorch/tests/test_distance_pt.py
imports: import numpy
  from itertools import product
  import pytest
  import torch
  from alibi_detect.utils.pytorch import GaussianRBF, mmd2, mmd2_from_kernel_matrix, permed_lsdds
  from alibi_detect.utils.pytorch import squared_pairwise_distance, batch_compute_kernel_matrix
label_desc: Use image node_id 10 for calling a global function with example usage: test_permed_lsdds(permed_lsdds_params) without return types