code: def testAllDTypes(self):
      context_features = [
          struct2tensor_parsing_utils.Feature("ctx.int", tf.int64),
          struct2tensor_parsing_utils.Feature("ctx.float", tf.float32),
          struct2tensor_parsing_utils.Feature("ctx.bytes", tf.string),
      ]
      example_features = [
          struct2tensor_parsing_utils.Feature("example_int", tf.int64),
          struct2tensor_parsing_utils.Feature(
              "example_float", tf.float32
          ),
          struct2tensor_parsing_utils.Feature(
              "example_bytes", tf.string
          ),
      ]
      decoder = struct2tensor_parsing_utils.ELWCDecoder(
          "test_decoder",
          context_features,
          example_features,
          size_feature_name=None,
          label_feature=None,
      )
  
      result = decoder.decode_record(tf.convert_to_tensor(_ELWCS))
      self.assertLen(
          result, len(context_features) + len(example_features)
      )
      for f in itertools.chain(context_features, example_features):
          self.assertIn(f.name, result)
          self.assertIsInstance(result[f.name], tf.RaggedTensor)
  
      expected = {
          "ctx.int": [[1, 2], [3]],
          "ctx.float": [[1.0, 2.0], [3.0]],
          "ctx.bytes": [[], [b"c"]],
          "example_int": [[[11], [22]], [[33]]],
          "example_float": [[[11.0, 12.0], []], [[14.0, 15.0]]],
          "example_bytes": [
              [[b"u", b"v"], [b"w"]],
              [[b"x", b"y", b"z"]],
          ],
      }
      self.assertEqual(
          {k: v.to_list() for k, v in result.items()}, expected
      )
  
file_path: tfx/tfx/examples/ranking/struct2tensor_parsing_utils_test.py
imports: import itertools
  import unittest
  import tensorflow
  from google.protobuf import text_format
  from tensorflow_serving.apis import input_pb2
label_desc: Use image node_id 1 for calling the ELWCDecoderTest obj's underlying member method code with example usage: obj.testAllDTypes() without return types