docstr: Compute the test-statistic (squared MMD) between the reference window and test window.
  
  Parameters
  ----------
  x_t
      A single instance to be added to the test-window.
  
  Returns
  -------
  Squared MMD estimate between reference window and test window.
docstr_tok: ["Compute","the","test-statistic","(","squared","MMD",")","between","the","reference","window","and","test","window",".","Parameters","--","--","--","--","--","x_t","A","single","instance","to","be","added","to","the","test-window",".","Returns","--","--","--","-","Squared","MMD","estimate","between","reference","window","and","test","window","."]
code: def score(self, x_t: Union[np.ndarray, Any]) -> float:
      """
      Compute the test-statistic (squared MMD) between the reference window and test window.
  
      Parameters
      ----------
      x_t
          A single instance to be added to the test-window.
  
      Returns
      -------
      Squared MMD estimate between reference window and test window.
      """
      x_t = super()._preprocess_xt(x_t)
      x_t = torch.from_numpy(x_t).to(self.device)
      self._update_state(x_t)
      k_yy = self.kernel(self.test_window, self.test_window)
      mmd = (
          self.k_xx_sub_sum
          + zero_diag(k_yy).sum()
          / (self.window_size * (self.window_size - 1))
          - 2 * self.k_xy.mean()
      )
      return float(mmd.detach().cpu())
  
file_path: alibi-detect/alibi_detect/cd/pytorch/mmd_online.py
imports: from tqdm import tqdm
  import numpy
  import torch
  from typing import Any, Callable, Optional, Union
  from alibi_detect.cd.base_online import BaseMultiDriftOnline
  from alibi_detect.utils.pytorch import get_device
  from alibi_detect.utils.pytorch.kernels import GaussianRBF
  from alibi_detect.utils.pytorch import zero_diag, quantile
  from alibi_detect.utils.frameworks import Framework
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 6 for calling the MMDDriftOnlineTorch obj's underlying member method code with example usage: obj.score(x_t) and returns: float