code: def test_svm_torchscript(tmp_path):
      """Tests user can torch-script svm detector."""
      sigma = torch.tensor(0.2)
      svm_detector = SVM(
          n_components=100,
          backend="pytorch",
          kernel=GaussianRBF(sigma=sigma),
      )
      X_ref, _ = make_moons(
          1001, shuffle=True, noise=0.05, random_state=None
      )
      X_ref, x_inlier = X_ref[0:1000], X_ref[1000][None]
      svm_detector.fit(X_ref, nu=0.1)
      svm_detector.infer_threshold(X_ref, 0.1)
      x_outlier = np.array([[-1, 1.5]])
      x = torch.tensor([x_inlier[0], x_outlier[0]], dtype=torch.float32)
  
      ts_svm = torch.jit.script(svm_detector.backend)
      y = ts_svm(x)
      assert torch.all(y == torch.tensor([False, True]))
  
      ts_svm.save(tmp_path / "svm.pt")
      ts_svm = torch.load(tmp_path / "svm.pt")
      y = ts_svm(x)
      assert torch.all(y == torch.tensor([False, True]))
  
file_path: alibi-detect/alibi_detect/od/tests/test__svm/test__svm.py
imports: import pytest
  import numpy
  import torch
  from alibi_detect.od._svm import SVM
  from alibi_detect.exceptions import NotFittedError
  from alibi_detect.utils.pytorch import GaussianRBF
  from sklearn.datasets import make_moons
label_desc: Use image node_id 8 for calling a global function with example usage: test_svm_torchscript(tmp_path) without return types