code: def test_encode_decode_tensor_shape(self):
      metadata = {
          "key1": tf.TensorShape(None),
          "key2": [
              tf.TensorShape([None]),
              tf.TensorShape([3, None, 5]),
          ],
      }
      string = json_utils.Encoder().encode(metadata)
      loaded = json_utils.decode(string)
  
      self.assertEqual(set(loaded.keys()), {"key1", "key2"})
      self.assertEqual(loaded["key1"].rank, None)
      self.assertAllEqual(loaded["key2"][0].as_list(), [None])
      self.assertAllEqual(loaded["key2"][1].as_list(), [3, None, 5])
  
file_path: keras/keras/legacy/saving/json_utils_test.py
imports: import enum
  import pytest
  from keras import backend
  from keras import testing
  from keras.legacy.saving import json_utils
label_desc: Use image node_id 1 for calling the JsonUtilsTestTF obj's underlying member method code with example usage: obj.test_encode_decode_tensor_shape() without return types