class_docstr: To serialize examples as tf.Example.
class_docstr_tok: ["To","serialize","examples","as","tf.Example","."]
docstr: Creates a TF Example for the given example.
  
  Args:
    example: Nested `dict` containing the input to serialize. The input
      structure and values dtype/shape must match the `example_specs` provided
      at construction.
  
  Returns:
    The `tf.train.Example` proto
docstr_tok: ["Creates","a","TF","Example","for","the","given","example",".","Args",":","example",":","Nested","`","dict","`","containing","the","input","to","serialize",".","The","input","structure","and","values","dtype\/shape","must","match","the","`","example_specs","`","provided","at","construction",".","Returns",":","The","`","tf.train.Example","`","proto"]
code: def get_tf_example(self, example: TreeDict[Any]) -> tf.train.Example:
      """Creates a TF Example for the given example.
  
      Args:
        example: Nested `dict` containing the input to serialize. The input
          structure and values dtype/shape must match the `example_specs` provided
          at construction.
  
      Returns:
        The `tf.train.Example` proto
      """
      return _dict_to_tf_example(
          utils.flatten_nest_dict(example), self._flat_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 2 for calling the ExampleSerializer obj's underlying member method code with example usage: obj.get_tf_example(example) and returns: _dict_to_tf_example