docstr: Computes the principal components of the data.
  
  Parameters
  ----------
  x
      The reference dataset.
docstr_tok: ["Computes","the","principal","components","of","the","data",".","Parameters","--","--","--","--","--","x","The","reference","dataset","."]
code: def _compute_linear_pcs(self, x: torch.Tensor):
      """Computes the principal components of the data.
  
      Parameters
      ----------
      x
          The reference dataset.
      """
      self.means = x.mean(0)
      x = x - self.means
      cov_mat = (x.t() @ x) / (len(x) - 1)
      D, V = torch.linalg.eigh(cov_mat)
      non_zero_inds = D > self.min_eigenvalue
      self.pcs = V[:, non_zero_inds] / D[None, non_zero_inds].sqrt()
  
file_path: alibi-detect/alibi_detect/od/pytorch/mahalanobis.py
imports: import torch
  from alibi_detect.od.pytorch.base import TorchOutlierDetector
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 5 for calling the MahalanobisTorch obj's underlying member method code with example usage: obj._compute_linear_pcs(x) without return types