code: def tf_feature_to_tfds_feature(
      nested: Union[tf.io.FixedLenFeature, Dict[Text, Any]]
  ):
      """Converts potentially nested tf features into tfds features."""
      if isinstance(nested, tf.io.FixedLenFeature):
          # For some reason the dicts are transposed within the tfds features.
          # See transpose_dict_list() under
          # tensorflow_datasets/core/features/sequence_feature.py
          return tfds.features.Tensor(
              shape=nested.shape[1:], dtype=nested.dtype
          )  # pytype: disable=attribute-error
      elif isinstance(nested, dict):
          ret = type(nested)()
          for k, v in nested.items():
              ret[k] = tf_feature_to_tfds_feature(v)
          return ret
      else:
          raise ValueError(f"Unsupported type {type(nested)}")
  
imports: from __future__ import annotations
  import collections
  import dataclasses
  import functools
  import os
  from typing import Any, Dict, Generator, Optional, Sequence, Text, Tuple, Union
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
  from tensorflow_datasets.rl_unplugged import rlu_common
label_desc: Use image node_id 5 for calling a global function with example usage: tf_feature_to_tfds_feature(nested) and returns: tfds, ret