class_docstr: Evaluator used for BERT global metrics evaluation.
class_docstr_tok: ["Evaluator","used","for","BERT","global","metrics","evaluation","."]
docstr: Add a batch of examples to the evaluator.
  
  Args:
    target: Target to be predicted as a Numpy array.
    output: Output from the model as a Numpy array.
docstr_tok: ["Add","a","batch","of","examples","to","the","evaluator",".","Args",":","target",":","Target","to","be","predicted","as","a","Numpy","array",".","output",":","Output","from","the","model","as","a","Numpy","array","."]
code: def add_batch_of_examples(
      self, target: np.ndarray, output: np.ndarray
  ):
      """Add a batch of examples to the evaluator.
  
      Args:
        target: Target to be predicted as a Numpy array.
        output: Output from the model as a Numpy array.
      """
      self._num_examples_added += output.shape[0]
      if self.batches is None:
          self.batches = (target, output)
      else:  # Append targets and outputs for the new examples.
          self.batches = (
              np.append(self.batches[0], target, axis=0),
              np.append(self.batches[1], output, axis=0),
          )
  
imports: import functools
  from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
  from absl import logging
  from clu import metric_writers
  import flax
  from flax import jax_utils
  import flax.linen
  import jax
  import jax.numpy
  import jax.profiler
  import ml_collections
  import numpy
  from scenic.common_lib import debug_utils
  from scenic.train_lib import optimizers
  from scenic.train_lib import train_utils
  import scipy
  import sklearn.metrics
label_desc: Use image node_id 2 for calling the BERTGlobalEvaluator obj's underlying member method code with example usage: obj.add_batch_of_examples(target, output) without return types