code: def testEncodeDecodeBoundedTensorSpec(self):
      structure = [
          tensor.BoundedTensorSpec(
              [1, 2, 3], dtypes.int64, 0, 10, "hello_0_10"
          )
      ]
      self.assertTrue(nested_structure_coder.can_encode(structure))
      encoded = nested_structure_coder.encode_structure(structure)
      expected = struct_pb2.StructuredValue()
      expected_list = expected.list_value
      expected_tensor_spec = (
          expected_list.values.add().bounded_tensor_spec_value
      )
      expected_tensor_spec.shape.dim.add().size = 1
      expected_tensor_spec.shape.dim.add().size = 2
      expected_tensor_spec.shape.dim.add().size = 3
      expected_tensor_spec.name = "hello_0_10"
      expected_tensor_spec.dtype = dtypes.int64.as_datatype_enum
      expected_tensor_spec.minimum.CopyFrom(
          tensor_util.make_tensor_proto(
              [0], dtype=dtypes.int64, shape=[]
          )
      )
      expected_tensor_spec.maximum.CopyFrom(
          tensor_util.make_tensor_proto(
              [10], dtype=dtypes.int64, shape=[]
          )
      )
      self.assertEqual(expected, encoded)
      decoded = nested_structure_coder.decode_proto(encoded)
      self.assertEqual(structure, decoded)
  
imports: import collections
  import typing
  import warnings
  import numpy
  from google.protobuf import text_format
  from tensorflow.core.protobuf import struct_pb2
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import extension_type
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework import test_util
  from tensorflow.python.framework import type_spec
  from tensorflow.python.framework import type_spec_registry
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.types import internal
label_desc: Use image node_id 16 for calling the NestedStructureCoderTest obj's underlying member method code with example usage: obj.testEncodeDecodeBoundedTensorSpec() without return types