class_docstr: Creates a table initializer from a `tf.data.Dataset`.
  
  Sample usage:
  
  >>> keys = tf.data.Dataset.range(100)
  >>> values = tf.data.Dataset.range(100).map(
  ...     lambda x: tf.strings.as_string(x * 2))
  >>> ds = tf.data.Dataset.zip((keys, values))
  >>> init = tf.data.experimental.DatasetInitializer(ds)
  >>> table = tf.lookup.StaticHashTable(init, "")
  >>> table.lookup(tf.constant([0, 1, 2], dtype=tf.int64)).numpy()
  array([b'0', b'2', b'4'], dtype=object)
  
  Attributes:
    dataset: A `tf.data.Dataset` object that produces tuples of scalars. The
      first scalar is treated as a key and the second as value.
  Raises: ValueError if `dataset` doesn't conform to specifications.
class_docstr_tok: ["Creates","a","table","initializer","from","a","`","tf.data.Dataset","`",".","Sample","usage",":",">",">",">","keys","=","tf.data.Dataset.range","(","100",")",">",">",">","values","=","tf.data.Dataset.range","(","100",")",".map","(","...","lambda","x",":","tf.strings.as_string","(","x","*","2",")",")",">",">",">","ds","=","tf.data.Dataset.zip","(","(","keys",",","values",")",")",">",">",">","init","=","tf.data.experimental.DatasetInitializer","(","ds",")",">",">",">","table","=","tf.lookup.StaticHashTable","(","init",",","``","''",")",">",">",">","table.lookup","(","tf.constant","(","[","0",",","1",",","2","]",",","dtype=tf.int64",")",")",".numpy","(",")","array","(","[","b","'","0","'",",","b","'","2","'",",","b","'","4","'","]",",","dtype=object",")","Attributes",":","dataset",":","A","`","tf.data.Dataset","`","object","that","produces","tuples","of","scalars",".","The","first","scalar","is","treated","as","a","key","and","the","second","as","value",".","Raises",":","ValueError","if","`","dataset","`","does","n't","conform","to","specifications","."]
code: def initialize(self, table):
      lookup_ops.check_table_dtypes(
          table, self._key_dtype, self._value_dtype
      )
      init_op = ged_ops.initialize_table_from_dataset(
          table.resource_handle, self.dataset._variant_tensor
      )  # pylint: disable=protected-access
      ops.add_to_collection(ops.GraphKeys.TABLE_INITIALIZERS, init_op)
      return init_op
  
file_path: tensorflow-upstream/tensorflow/python/data/experimental/ops/lookup_ops.py
imports: from tensorflow.python.data.experimental.ops.cardinality import assert_cardinality
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.ops import gen_experimental_dataset_ops
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 2 for calling the DatasetInitializer obj's underlying member method code with example usage: obj.initialize(table) and returns: init_op