class_docstr: Base class for torch backend outlier detection algorithms.
class_docstr_tok: ["Base","class","for","torch","backend","outlier","detection","algorithms","."]
docstr: Predict outlier labels for the data.
  
  Computes the outlier scores. If the detector is not fit on reference data we raise an error.
  If the threshold is inferred, the outlier labels and p-values are also computed and returned.
  Otherwise, the outlier labels and p-values are set to ``None``.
  
  Parameters
  ----------
  x
      Data to predict.
  
  Returns
  -------
  Output of the outlier detector. Includes the p-values, outlier labels, instance scores and threshold.
  
  Raises
  ------
  ValueError
      Raised if the detector is not fit on reference data.
docstr_tok: ["Predict","outlier","labels","for","the","data",".","Computes","the","outlier","scores",".","If","the","detector","is","not","fit","on","reference","data","we","raise","an","error",".","If","the","threshold","is","inferred",",","the","outlier","labels","and","p-values","are","also","computed","and","returned",".","Otherwise",",","the","outlier","labels","and","p-values","are","set","to","``","None","``",".","Parameters","--","--","--","--","--","x","Data","to","predict",".","Returns","--","--","--","-","Output","of","the","outlier","detector",".","Includes","the","p-values",",","outlier","labels",",","instance","scores","and","threshold",".","Raises","--","--","--","ValueError","Raised","if","the","detector","is","not","fit","on","reference","data","."]
code: def predict(self, x: torch.Tensor) -> TorchOutlierDetectorOutput:
      """Predict outlier labels for the data.
  
      Computes the outlier scores. If the detector is not fit on reference data we raise an error.
      If the threshold is inferred, the outlier labels and p-values are also computed and returned.
      Otherwise, the outlier labels and p-values are set to ``None``.
  
      Parameters
      ----------
      x
          Data to predict.
  
      Returns
      -------
      Output of the outlier detector. Includes the p-values, outlier labels, instance scores and threshold.
  
      Raises
      ------
      ValueError
          Raised if the detector is not fit on reference data.
      """
      self.check_fitted()
      raw_scores = self.score(x)
      scores = self._ensembler(raw_scores)
  
      return TorchOutlierDetectorOutput(
          instance_score=scores,
          is_outlier=self._classify_outlier(scores),
          p_value=self._p_vals(scores),
          threshold_inferred=self.threshold_inferred,
          threshold=self.threshold,
      )
  
imports: from typing import List, Union, Optional, Dict
  from dataclasses import dataclass, fields
  from abc import ABC, abstractmethod
  import numpy
  import torch
  from alibi_detect.od.pytorch.ensemble import FitMixinTorch
  from alibi_detect.utils.pytorch.misc import get_device
  from alibi_detect.exceptions import ThresholdNotInferredError
  from alibi_detect.utils._types import TorchDeviceType
label_desc: Use image node_id 10 for calling the TorchOutlierDetector obj's underlying member method code with example usage: obj.predict(x) and returns: TorchOutlierDetectorOutput