docstr: Simple test to cover batch_size=None code path.
docstr_tok: ["Simple","test","to","cover","batch_size=None","code","path","."]
code: def testPredictionsExtractorNoDefinedBatchSize(self):
      """Simple test to cover batch_size=None code path."""
      temp_export_dir = self._getExportDir()
      (
          export_dir,
          _,
      ) = fixed_prediction_estimator_extra_fields.simple_fixed_prediction_estimator_extra_fields(
          temp_export_dir, None
      )
  
      eval_config = config_pb2.EvalConfig(
          model_specs=[config_pb2.ModelSpec()]
      )
      eval_shared_model = self.createTestEvalSharedModel(
          eval_saved_model_path=export_dir,
          tags=[tf.saved_model.SERVING],
      )
      (
          tfx_io,
          feature_extractor,
      ) = self._create_tfxio_and_feature_extractor(
          eval_config,
          text_format.Parse(
              """
          feature {
            name: "prediction"
            type: FLOAT
          }
          feature {
            name: "label"
            type: FLOAT
          }
          feature {
            name: "fixed_int"
            type: INT
          }
          feature {
            name: "fixed_float"
            type: FLOAT
          }
          feature {
            name: "fixed_string"
            type: BYTES
          }
          """,
              schema_pb2.Schema(),
          ),
      )
  
      examples = [
          self._makeExample(
              prediction=0.2,
              label=1.0,
              fixed_int=1,
              fixed_float=1.0,
              fixed_string="fixed_string1",
          ),
          self._makeExample(
              prediction=0.8,
              label=0.0,
              fixed_int=1,
              fixed_float=1.0,
              fixed_string="fixed_string2",
          ),
          self._makeExample(
              prediction=0.5,
              label=0.0,
              fixed_int=2,
              fixed_float=1.0,
              fixed_string="fixed_string3",
          ),
      ]
  
      prediction_extractor = predictions_extractor.PredictionsExtractor(
          eval_config=eval_config, eval_shared_model=eval_shared_model
      )
  
      with beam.Pipeline() as pipeline:
          # pylint: disable=no-value-for-parameter
          result = (
              pipeline
              | "Create"
              >> beam.Create(
                  [e.SerializeToString() for e in examples],
                  reshuffle=False,
              )
              | "BatchExamples" >> tfx_io.BeamSource()
              | "InputsToExtracts"
              >> model_eval_lib.BatchedInputsToExtracts()
              | feature_extractor.stage_name
              >> feature_extractor.ptransform
              | prediction_extractor.stage_name
              >> prediction_extractor.ptransform
              | beam.FlatMap(
                  lambda extracts: extracts[constants.PREDICTIONS_KEY]
              )
          )
          # pylint: enable=no-value-for-parameter
  
          util.assert_that(
              result,
              util.equal_to(
                  [np.array([0.2]), np.array([0.8]), np.array([0.5])],
                  equals_fn=np.isclose,
              ),
          )
  
imports: import os
  from absl.testing import parameterized
  import apache_beam
  from apache_beam.testing import util
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.eval_saved_model.example_trainers import batch_size_limited_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import dnn_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator_extra_fields
  from tensorflow_model_analysis.eval_saved_model.example_trainers import multi_head
  from tensorflow_model_analysis.extractors import features_extractor
  from tensorflow_model_analysis.extractors import predictions_extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tfx_bsl.tfxio import tensor_adapter
  from tfx_bsl.tfxio import test_util
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 4 for calling the PredictionsExtractorTest obj's underlying member method code with example usage: obj.testPredictionsExtractorNoDefinedBatchSize() without return types