class_docstr: Abstract class that defines a Heuristic.
  
  Args:
      shuffle_prop (float): shuffle proportion.
      reverse (bool): True if the most uncertain sample has the highest value.
      reduction (Union[str, Callable]): Reduction used after computing the score.
class_docstr_tok: ["Abstract","class","that","defines","a","Heuristic",".","Args",":","shuffle_prop","(","float",")",":","shuffle","proportion",".","reverse","(","bool",")",":","True","if","the","most","uncertain","sample","has","the","highest","value",".","reduction","(","Union","[","str",",","Callable","]",")",":","Reduction","used","after","computing","the","score","."]
docstr: Compute the score according to the heuristic.
  
  Args:
      predictions (Iterable): Generator of predictions
  
  Raises:
      ValueError if the generator is empty.
  
  Returns:
      Array of scores.
docstr_tok: ["Compute","the","score","according","to","the","heuristic",".","Args",":","predictions","(","Iterable",")",":","Generator","of","predictions","Raises",":","ValueError","if","the","generator","is","empty",".","Returns",":","Array","of","scores","."]
code: def get_uncertainties_generator(self, predictions):
      """
      Compute the score according to the heuristic.
  
      Args:
          predictions (Iterable): Generator of predictions
  
      Raises:
          ValueError if the generator is empty.
  
      Returns:
          Array of scores.
      """
      acc = []
      for pred in predictions:
          acc.append(self.get_uncertainties(pred))
      if len(acc) == 0:
          raise ValueError("No prediction! Cannot order the values!")
      return np.concatenate(acc)
  
imports: import types
  import warnings
  from collections.abc import Sequence
  from functools import wraps
  from typing import List
  import numpy
  import scipy.stats
  import torch
  from scipy.special import xlogy
  from torch import Tensor
  from baal.utils.array_utils import to_prob
label_desc: Use image node_id 3 for calling the AbstractHeuristic obj's underlying member method code with example usage: obj.get_uncertainties_generator(predictions) and returns: np