docstr: Averages the scores of the detectors in an ensemble. If weights were passed in the `__init__`
  then these are used to weight the scores.
  
  Parameters
  ----------
  scores
      `Torch.Tensor` of scores from ensemble of detectors.
  
  Returns
  -------
  `Torch.Tensor` of mean of scores.
docstr_tok: ["Averages","the","scores","of","the","detectors","in","an","ensemble",".","If","weights","were","passed","in","the","`","__init__","`","then","these","are","used","to","weight","the","scores",".","Parameters","--","--","--","--","--","scores","`","Torch.Tensor","`","of","scores","from","ensemble","of","detectors",".","Returns","--","--","--","-","`","Torch.Tensor","`","of","mean","of","scores","."]
code: def transform(self, scores: torch.Tensor) -> torch.Tensor:
      """Averages the scores of the detectors in an ensemble. If weights were passed in the `__init__`
      then these are used to weight the scores.
  
      Parameters
      ----------
      scores
          `Torch.Tensor` of scores from ensemble of detectors.
  
      Returns
      -------
      `Torch.Tensor` of mean of scores.
      """
      if self.weights is None:
          m = scores.shape[-1]
          self.weights = torch.ones(m, device=scores.device) / m
      return scores @ self.weights
  
imports: from abc import ABC, abstractmethod
  from typing import Optional
  from typing_extensions import Self
  import torch
  import numpy
  from torch.nn import Module
  from alibi_detect.exceptions import NotFittedError
label_desc: Use image node_id 2 for calling the AverageAggregator obj's underlying member method code with example usage: obj.transform(scores) and returns: unknown