class_docstr: Test class with extra methods for unit-testing TFMA models / metrics.
class_docstr_tok: ["Test","class","with","extra","methods","for","unit-testing","TFMA","models","\/","metrics","."]
docstr: Checks metrics in-memory using the low-level APIs without Beam.
  
  Example usage:
    self.assertMetricsComputedWithoutBeamAre(
      eval_saved_model_path=path,
      serialized_examples=[self.makeExample(age=5, label=1.0),
                           self.makeExample(age=10, label=0.0)],
      expected_metrics={'average_loss': 0.1})
  
  Args:
    eval_saved_model_path: Path to the directory containing the
      EvalSavedModel.
    serialized_examples: List of serialized example bytes.
    expected_metrics: Dictionary of expected metric values.
docstr_tok: ["Checks","metrics","in-memory","using","the","low-level","APIs","without","Beam",".","Example","usage",":","self.assertMetricsComputedWithoutBeamAre","(","eval_saved_model_path=path",",","serialized_examples=","[","self.makeExample","(","age=5",",","label=1.0",")",",","self.makeExample","(","age=10",",","label=0.0",")","]",",","expected_metrics=","{","'average_loss","'",":","0.1","}",")","Args",":","eval_saved_model_path",":","Path","to","the","directory","containing","the","EvalSavedModel",".","serialized_examples",":","List","of","serialized","example","bytes",".","expected_metrics",":","Dictionary","of","expected","metric","values","."]
code: def assertMetricsComputedWithoutBeamAre(
      self,
      eval_saved_model_path: str,
      serialized_examples: List[bytes],
      expected_metrics: Dict[str, Any],
  ):
      """Checks metrics in-memory using the low-level APIs without Beam.
  
      Example usage:
        self.assertMetricsComputedWithoutBeamAre(
          eval_saved_model_path=path,
          serialized_examples=[self.makeExample(age=5, label=1.0),
                               self.makeExample(age=10, label=0.0)],
          expected_metrics={'average_loss': 0.1})
  
      Args:
        eval_saved_model_path: Path to the directory containing the
          EvalSavedModel.
        serialized_examples: List of serialized example bytes.
        expected_metrics: Dictionary of expected metric values.
      """
      self.assertDictElementsWithinBounds(
          got_values_dict=self._computeMetricsWithoutBeam(
              eval_saved_model_path, serialized_examples
          ),
          expected_values_dict=expected_metrics,
      )
  
imports: from typing import Any, Dict, List, Optional
  import apache_beam
  from apache_beam.testing import util
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import load
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.evaluators import legacy_metrics_and_plots_evaluator
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tfx_bsl.tfxio import raw_tf_record
label_desc: Use image node_id 3 for calling the TestCase obj's underlying member method code with example usage: obj.assertMetricsComputedWithoutBeamAre(eval_saved_model_path, serialized_examples, expected_metrics) without return types