class_docstr: Top-level `FeatureConnector` to manage decoding.
  
  Note that `FeatureConnector` which are declared as `TopLevelFeature` can be
  nested. However, only the top-level feature should be decoded.
  
  `TopLevelFeature` allows better control over the decoding, and
  eventually better support for augmentations.
class_docstr_tok: ["Top-level","`","FeatureConnector","`","to","manage","decoding",".","Note","that","`","FeatureConnector","`","which","are","declared","as","`","TopLevelFeature","`","can","be","nested",".","However",",","only","the","top-level","feature","should","be","decoded",".","`","TopLevelFeature","`","allows","better","control","over","the","decoding",",","and","eventually","better","support","for","augmentations","."]
docstr: Decode the serialize examples.
  
  Args:
    serialized_example: Nested `dict` of `tf.Tensor`
    decoders: Nested dict of `Decoder` objects which allow to customize the
      decoding. The structure should match the feature structure, but only
      customized feature keys need to be present. See [the
      guide](https://github.com/tensorflow/datasets/blob/master/docs/decode.md)
      for more info.
    backend: whether to use `decode_example` (TensorFlow) or
      `decode_example_np` (NumPy).
  
  Returns:
    example: Nested `dict` containing the decoded nested examples.
docstr_tok: ["Decode","the","serialize","examples",".","Args",":","serialized_example",":","Nested","`","dict","`","of","`","tf.Tensor","`","decoders",":","Nested","dict","of","`","Decoder","`","objects","which","allow","to","customize","the","decoding",".","The","structure","should","match","the","feature","structure",",","but","only","customized","feature","keys","need","to","be","present",".","See","[","the","guide","]","(","https",":","\/\/github.com\/tensorflow\/datasets\/blob\/master\/docs\/decode.md",")","for","more","info",".","backend",":","whether","to","use","`","decode_example","`","(","TensorFlow",")","or","`","decode_example_np","`","(","NumPy",")",".","Returns",":","example",":","Nested","`","dict","`","containing","the","decoded","nested","examples","."]
code: def _decode_example_generic(
      self, serialized_example, *, decoders=None, backend=_Backend.TF
  ):
      """Decode the serialize examples.
  
      Args:
        serialized_example: Nested `dict` of `tf.Tensor`
        decoders: Nested dict of `Decoder` objects which allow to customize the
          decoding. The structure should match the feature structure, but only
          customized feature keys need to be present. See [the
          guide](https://github.com/tensorflow/datasets/blob/master/docs/decode.md)
          for more info.
        backend: whether to use `decode_example` (TensorFlow) or
          `decode_example_np` (NumPy).
  
      Returns:
        example: Nested `dict` containing the decoded nested examples.
      """
      # Step 1: Flatten the nested dict => []
      flat_example = self._flatten(serialized_example)
      flat_decoders = self._flatten(decoders)
  
      # Step 2: Apply the decoding
      flatten_decoded = [
          _decode_feature(  # pylint: disable=g-complex-comprehension
              feature=feature,
              example=example,
              decoder=decoder,
              sequence_rank=sequence_rank,
              backend=backend,
          )
          for (
              feature,
              example,
              decoder,
              sequence_rank,
          ) in zip(
              self.flat_features,
              flat_example,
              flat_decoders,
              self.flat_sequence_ranks,
          )
      ]
  
      # Step 3: Restore nesting [] => {}
      nested_decoded = self._nest(flatten_decoded)
      return nested_decoded
  
imports: from __future__ import annotations
  import enum
  import functools
  from typing import Any, List, Union
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import example_serializer
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 4 for calling the TopLevelFeature obj's underlying member method code with example usage: obj._decode_example_generic(serialized_example) and returns: nested_decoded