class_docstr: To serialize examples as tf.Example.
class_docstr_tok: ["To","serialize","examples","as","tf.Example","."]
docstr: Constructor.
  
  Args:
    example_specs: Nested `dict` of `tfds.features.TensorInfo`, corresponding
      to the structure of data to write/read.
docstr_tok: ["Constructor",".","Args",":","example_specs",":","Nested","`","dict","`","of","`","tfds.features.TensorInfo","`",",","corresponding","to","the","structure","of","data","to","write\/read","."]
code: def __init__(self, example_specs: TreeDict[TensorInfo]):
      """Constructor.
  
      Args:
        example_specs: Nested `dict` of `tfds.features.TensorInfo`, corresponding
          to the structure of data to write/read.
      """
      super().__init__(example_specs)
      self._flat_example_specs = utils.flatten_nest_dict(
          self.example_specs
      )
  
imports: from __future__ import annotations
  import abc
  import collections
  import dataclasses
  from typing import Any, Mapping, Union
  import numpy
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.utils import dtype_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  from tensorflow_datasets.proto import tf_example_pb2
  from tensorflow_datasets.proto import tf_feature_pb2
label_desc: Use image node_id 1 to create a new ExampleSerializer object from inherited base classes: Serializer with example: obj = ExampleSerializer(example_specs)