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.
  
  This is the non-batched version of assertMetricsComputedWithoutBeamAre.
  This can be useful for debugging batching issues with TFMA or with your
  model (e.g. your model or metrics only works with a fixed-batch size - TFMA
  requires that your model can accept batches of any size).
  
  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",".","This","is","the","non-batched","version","of","assertMetricsComputedWithoutBeamAre",".","This","can","be","useful","for","debugging","batching","issues","with","TFMA","or","with","your","model","(","e.g",".","your","model","or","metrics","only","works","with","a","fixed-batch","size","-","TFMA","requires","that","your","model","can","accept","batches","of","any","size",")",".","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 assertMetricsComputedWithoutBeamNoBatchingAre(
      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.
  
      This is the non-batched version of assertMetricsComputedWithoutBeamAre.
      This can be useful for debugging batching issues with TFMA or with your
      model (e.g. your model or metrics only works with a fixed-batch size - TFMA
      requires that your model can accept batches of any size).
  
      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._computeMetricsWithoutBeamNoBatching(
              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 4 for calling the TestCase obj's underlying member method code with example usage: obj.assertMetricsComputedWithoutBeamNoBatchingAre(eval_saved_model_path, serialized_examples, expected_metrics) without return types