def __init__(self,
               graph,
               input_signature,
               replaced_tensors_ready,
               translate_path_fn=None):
    """Init method for InitializableGraphAnalyzer.

    Args:
      graph: a `Graph`.
      input_signature: A dict whose keys are strings and values are `Tensor`s,
        `SparseTensor`s, or `RaggedTensor`s.
      replaced_tensors_ready: a list of `Tensor`, `SparseTensor`s, or
        `RaggedTensor`s, bool pairs indicating whether the `Tensor`,
        `SparseTensor`s, or `RaggedTensor`s is ready in this phase.
      translate_path_fn: (Optional) A function with the signature: (identifier,
        optional(parents)) -> Any which will be used to construct a unique path
        for a given `Tensor`.

    Raises:
      ValueError: If unexpected placeholders or tables are encountered, or table
          initializers do not have the expected structure in the graph.
    """

    if translate_path_fn is None:
      translate_path_fn = lambda x, parents=None: None

    self._ready_table_initializers = []
    self._input_signature = input_signature
    replaced_tensors_ready = {tf_utils.hashable_tensor_or_op(t): ready
                              for t, ready in replaced_tensors_ready}

    initial_source_infos_dict = self._make_source_infos_dict(
        {}, replaced_tensors_ready)

    # Determine which table initializers are ready, based on the replaced
    # tensors. Since no input tensors are fed during table initialization, we do
    # not set the value of any tensors in `input_signature`.
    graph_analyzer_for_table_init = _GraphAnalyzer(initial_source_infos_dict,
                                                   translate_path_fn, graph)
    complete_source_info_dict = self._make_source_infos_dict(
        input_signature, replaced_tensors_ready)

    for table_init_op_or_tensor in graph.get_collection(
        tf.compat.v1.GraphKeys.TABLE_INITIALIZERS):
      # Handle the case when an initializer was lifted out of the graph context.
      if table_init_op_or_tensor is None:
        continue

      if isinstance(graph, tf_func_graph.FuncGraph):
        self._log_warning('Tables initialized inside a tf.function  will be'
                          ' re-initialized on every invocation of the function.'
                          ' This  re-initialization can have significant impact'
                          ' on performance. Consider lifting  them out of the'
                          ' graph context using  `tf.init_scope`.: {}'.format(
                              table_init_op_or_tensor.name))

      table_init_op, table_input_ops = (
          self._get_table_init_op_and_inputs(table_init_op_or_tensor))
      source_info = self._get_table_init_op_source_info(
          table_init_op, graph_analyzer_for_table_init, translate_path_fn)

      for key in table_input_ops:
        complete_source_info_dict[tf_utils.hashable_tensor_or_op(
            key)] = source_info
      if source_info.is_ready_to_run:
        self._ready_table_initializers.append(table_init_op_or_tensor)

    # Now determine which tensors are ready to run once the table has been
    # initialized.
    self._graph_analyzer = _GraphAnalyzer(complete_source_info_dict,
                                          translate_path_fn, graph)
Init method for InitializableGraphAnalyzer.

    Args:
      graph: a `Graph`.
      input_signature: A dict whose keys are strings and values are `Tensor`s,
        `SparseTensor`s, or `RaggedTensor`s.
      replaced_tensors_ready: a list of `Tensor`, `SparseTensor`s, or
        `RaggedTensor`s, bool pairs indicating whether the `Tensor`,
        `SparseTensor`s, or `RaggedTensor`s is ready in this phase.
      translate_path_fn: (Optional) A function with the signature: (identifier,
        optional(parents)) -> Any which will be used to construct a unique path
        for a given `Tensor`.

    Raises:
      ValueError: If unexpected placeholders or tables are encountered, or table
          initializers do not have the expected structure in the graph.
    
tensorflow_transform/graph_tools.py