class_docstr: Detector class.
  
  The detector is is a `nn.Module` subclass that, after fitting, performs a drift test when called and returns a score or p-value.
  
      Constructor Args:
              return_p_value (bool): If set, forward returns a p-value (estimate) instead of the raw test score.
docstr: Performs a statistical test for drift and returns the score or, if `return_p_value` has been set in the constructor, the p-value.
  
  This method calls `predict_shift_from_features` under the hood, so you only need to override that when subclassing.
code: def forward(
      self, inputs: torch.Tensor, individual_samples: bool = False
  ) -> torch.Tensor:
      """Performs a statistical test for drift and returns the score or, if `return_p_value` has been set in the constructor, the p-value.
  
      This method calls `predict_shift_from_features` under the hood, so you only need to override that when subclassing.
      """
      torchdrift.utils.check(
          self.base_outputs is not None,
          "Please call fit before predict_shift",
      )
      ood_score, p_value = self.predict_shift_from_features(
          self.base_outputs,
          inputs,
          compute_score=not self.return_p_value,
          compute_p_value=self.return_p_value,
          individual_samples=individual_samples,
      )
      if self.return_p_value:
          return p_value
      return ood_score
  
file_path: TorchDrift/torchdrift/detectors/detector.py
imports: import torch
  import torchdrift.utils
label_desc: Use image node_id 5 for calling the Detector obj's underlying member method code with example usage: obj.forward(inputs, individual_samples) and returns: ood_score, p_value