code: def testInputSpecsToTensorRepresentations(self):
      tensor_representations = (
          model_util.input_specs_to_tensor_representations(
              {
                  "input_1": tf.TensorSpec(
                      shape=(None, 2), dtype=tf.int64
                  ),
                  "input_2": tf.SparseTensorSpec(
                      shape=(None, 1), dtype=tf.float32
                  ),
                  "input_3": tf.RaggedTensorSpec(
                      shape=(None, None), dtype=tf.float32
                  ),
              }
          )
      )
      dense_tensor_representation = text_format.Parse(
          """
          dense_tensor {
            column_name: "input_1"
            shape { dim { size: 2 } }
          }
          """,
          schema_pb2.TensorRepresentation(),
      )
      sparse_tensor_representation = text_format.Parse(
          """
          varlen_sparse_tensor {
            column_name: "input_2"
          }
          """,
          schema_pb2.TensorRepresentation(),
      )
      ragged_tensor_representation = text_format.Parse(
          """
          ragged_tensor {
            feature_path {
              step: "input_3"
            }
          }
          """,
          schema_pb2.TensorRepresentation(),
      )
      self.assertEqual(
          {
              "input_1": dense_tensor_representation,
              "input_2": sparse_tensor_representation,
              "input_3": ragged_tensor_representation,
          },
          tensor_representations,
      )
  
imports: import tempfile
  import unittest
  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 types
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
  from tfx_bsl.tfxio import tf_example_record
  from google.protobuf import text_format
  from tensorflow.core.protobuf import saved_model_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 22 for calling the ModelUtilTest obj's underlying member method code with example usage: obj.testInputSpecsToTensorRepresentations() without return types