code: def _test_detector_class_fit_bootstrap(cls):
      devices = ["cpu"] + (
          ["cuda"] if torch.cuda.is_available() else []
      )
      for device in devices:
          torch.manual_seed(1234)
          d = cls()
          x = torch.randn(100, 5, device=device)
          y = torch.randn(50, 5, device=device) + 1.0
          z = torch.randn(50, 5, device=device)
          d.fit(x, n_test=50)
          assert d.compute_p_value(x[:50]) > 0.80
          assert d.compute_p_value(y) < 0.05
          p = d.compute_p_value(y)
          assert p.device == x.device
  
file_path: TorchDrift/test/test_detectors.py
imports: import pytest
  import functools
  import torchdrift
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: _test_detector_class_fit_bootstrap(cls) without return types