code: def testModelShapes(self):
      # Builds a graph.
      v0 = tf.Variable(
          [[1, 2, 3], [4, 5, 6]], dtype=tf.float32, name="v0"
      )
      v1 = tf.Variable(
          [[[1], [2]], [[3], [4]], [[5], [6]]],
          dtype=tf.float32,
          name="v1",
      )
      init_all_op = tf.compat.v1.initialize_all_variables()
      save = tf.compat.v1.train.Saver({"v0": v0, "v1": v1})
      save_path = test_utils.test_tmpfile("ckpt_for_debug_string")
      with tf.compat.v1.Session() as sess:
          sess.run(init_all_op)
          # Saves a checkpoint.
          save.save(sess, save_path)
  
          # Model shapes without any variable requests gives you all variables.
          self.assertEqual(
              {"v0": (2, 3), "v1": (3, 2, 1)},
              dv_utils.model_shapes(save_path),
          )
          # Asking for v0 gives you only v0's shape.
          self.assertEqual(
              {"v0": (2, 3)}, dv_utils.model_shapes(save_path, ["v0"])
          )
          # Asking for v1 gives you only v1's shape.
          self.assertEqual(
              {"v1": (3, 2, 1)},
              dv_utils.model_shapes(save_path, ["v1"]),
          )
  
          # Verifies model_shapes() fails for non-existent tensors.
          with self.assertRaisesRegex(KeyError, "v3"):
              dv_utils.model_shapes(save_path, ["v3"])
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import tensorflow
  from deepvariant import dv_utils
  from tensorflow.python.platform import gfile
  from third_party.nucleus.io import tfrecord
  from third_party.nucleus.protos import variants_pb2
  from third_party.nucleus.testing import test_utils
  from tensorflow.core.example import example_pb2
label_desc: Use image node_id 2 for calling the TFUtilsTest obj's underlying member method code with example usage: obj.testModelShapes() without return types