code: def testPredictListForSequenceModel(self):
      # Check that the merge and split Tensor operations correctly work with
      # features with three dimensions: batch size x timestep x feature size
      temp_eval_export_dir = self._getEvalExportDir()
      (
          _,
          eval_export_dir,
      ) = fake_sequence_to_prediction.simple_fake_sequence_to_prediction(
          None, temp_eval_export_dir
      )
  
      eval_saved_model = load.EvalSavedModel(eval_export_dir)
      example1 = self._makeExample(values_t1=1.0, label=3.0 + 12.0)
      example2 = self._makeExample(values_t2=3.0, label=18.0 + 195.0)
      example3 = self._makeExample(
          values_t1=2.0, values_t3=5.0, label=51.0 + 986.0
      )
      example4 = self._makeExample(
          values_t1=5.0,
          values_t2=7.0,
          values_t3=11.0,
          label=156.0 + 11393.0,
      )
  
      examples_list = [
          example1.SerializeToString(),
          example2.SerializeToString(),
          example3.SerializeToString(),
          example4.SerializeToString(),
      ]
  
      with tf.compat.v1.Session() as sess:
          features_predictions_labels_list = (
              self.predict_injective_example_list(
                  eval_saved_model, examples_list
              )
          )
  
          self.assertAllEqual(
              np.array(
                  [[[1, 1, 1], [0, 0, 0], [0, 0, 0]]], dtype=np.float64
              ),
              features_predictions_labels_list[0].features["embedding"][
                  encoding.NODE_SUFFIX
              ],
          )
          self.assertAllEqual(
              np.array(
                  [[[0, 0, 0], [3, 3, 3], [0, 0, 0]]], dtype=np.float64
              ),
              features_predictions_labels_list[1].features["embedding"][
                  encoding.NODE_SUFFIX
              ],
          )
          self.assertAllEqual(
              np.array(
                  [[[2, 2, 2], [0, 0, 0], [5, 5, 5]]], dtype=np.float64
              ),
              features_predictions_labels_list[2].features["embedding"][
                  encoding.NODE_SUFFIX
              ],
          )
          self.assertAllEqual(
              np.array(
                  [[[5, 5, 5], [7, 7, 7], [11, 11, 11]]],
                  dtype=np.float64,
              ),
              features_predictions_labels_list[3].features["embedding"][
                  encoding.NODE_SUFFIX
              ],
          )
  
          def to_dense(sparse_tensor_value):
              return sess.run(tf.sparse.to_dense(sparse_tensor_value))
  
          self.assertAllEqual(
              np.array(
                  [[[1, 1, 1], [0, 0, 0], [0, 0, 0]]], dtype=np.float64
              ),
              to_dense(
                  features_predictions_labels_list[0].features[
                      "sparse_values"
                  ][encoding.NODE_SUFFIX]
              ),
          )
          self.assertAllEqual(
              np.array(
                  [[[0, 0, 0], [3, 9, 27], [0, 0, 0]]], dtype=np.float64
              ),
              to_dense(
                  features_predictions_labels_list[1].features[
                      "sparse_values"
                  ][encoding.NODE_SUFFIX]
              ),
          )
          self.assertAllEqual(
              np.array(
                  [[[2, 4, 8], [0, 0, 0], [5, 25, 125]]],
                  dtype=np.float64,
              ),
              to_dense(
                  features_predictions_labels_list[2].features[
                      "sparse_values"
                  ][encoding.NODE_SUFFIX]
              ),
          )
          self.assertAllEqual(
              np.array(
                  [[[5, 25, 125], [7, 49, 343], [11, 121, 1331]]],
                  dtype=np.float64,
              ),
              to_dense(
                  features_predictions_labels_list[3].features[
                      "sparse_values"
                  ][encoding.NODE_SUFFIX]
              ),
          )
  
          eval_saved_model.metrics_reset_update_get_list(examples_list)
          metric_values = eval_saved_model.get_metric_values()
  
          self.assertDictElementsAlmostEqual(
              metric_values,
              {
                  "mean_squared_error": 0.0,
                  "mean_prediction": 3203.5,
              },
          )
  
imports: import os
  import numpy
  import tensorflow
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import load
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.eval_saved_model.example_trainers import control_dependency_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import csv_linear_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import custom_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import dnn_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fake_multi_examples_per_input_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fake_sequence_to_prediction
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator
  from tensorflow_model_analysis.eval_saved_model.example_trainers import fixed_prediction_estimator_no_labels
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier
  from tensorflow_model_analysis.eval_saved_model.example_trainers import linear_classifier_multivalent
  from tensorflow_model_analysis.eval_saved_model.example_trainers import multi_head
  from tensorflow_model_analysis.post_export_metrics import metrics
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 9 for calling the IntegrationTest obj's underlying member method code with example usage: obj.testPredictListForSequenceModel() and returns: sess