code: def test_partial_mmd_detector():
      _test_detector_class_fit_bootstrap(
          torchdrift.detectors.PartialKernelMMDDriftDetector
      )
      pmmd = functools.partial(
          torchdrift.detectors.PartialKernelMMDDriftDetector,
          fraction_to_match=0.5,
          n_perm=100,
      )
      _test_detector_class_fit_bootstrap(pmmd)
      pmmd_approx = functools.partial(
          torchdrift.detectors.PartialKernelMMDDriftDetector,
          method=torchdrift.detectors.PartialKernelMMDDriftDetector.METHOD_APPROX,
          fraction_to_match=0.5,
          n_perm=100,
      )
      _test_detector_class_fit_bootstrap(pmmd_approx)
      pmmd_approx = functools.partial(
          torchdrift.detectors.PartialKernelMMDDriftDetector,
          method=torchdrift.detectors.PartialKernelMMDDriftDetector.METHOD_APPROX,
          n_perm=100,
          fraction_to_match=1.0,  # corner case
      )
      _test_detector_class_fit_bootstrap(pmmd_approx)
      pmmd_qp = functools.partial(
          torchdrift.detectors.PartialKernelMMDDriftDetector,
          method=torchdrift.detectors.PartialKernelMMDDriftDetector.METHOD_QP,
          n_perm=100,
          fraction_to_match=0.5,
      )
      _test_detector_class_fit_bootstrap(pmmd_qp)
  
      # Check that we can also just get the distance...
      dd = torchdrift.detectors.PartialKernelMMDDriftDetector(
          fraction_to_match=0.5
      )
      x = torch.randn(5, 5)
      y = torch.randn(5, 5) + 1.0
      dd.fit(x)
      dd(y)
  
file_path: TorchDrift/test/test_detectors.py
imports: import pytest
  import functools
  import torchdrift
  import torch
label_desc: Use image node_id 8 for calling a global function with example usage: test_partial_mmd_detector() without return types