def __init__(
      self,
      dataset_keys: Collection[analyzer_cache.DatasetKey],
      cache_dict: Optional[analyzer_cache.BeamAnalysisCache],
      tensor_keys_to_paths: Mapping[str, str],
      cache_output_nodes: _IntermediateCacheType,
      num_phases: int,
  ):
    """Init method for _OptimizeVisitor.

    Args:
      dataset_keys: An iterable of strings which are keys for a partitioned
        dataset.
      cache_dict: A dictionary of input cache that can be used in place of a
        cacheable accumulate operation. A dictionary from dataset_keys to
        dictionaries of cache keys to PCollections. This can be None if there is
        no cache.
      tensor_keys_to_paths: A dictionary from a tensor key to a unique TF graph
        path hash.
      cache_output_nodes: A dictionary from (dataset_key, cache_key) to encoded
        cache ValueNode. This is the output cache for this graph.
      num_phases: The number of phases of analysis.
    """
    self._sorted_dataset_keys = sorted(dataset_keys)
    self._cache_dict = cache_dict
    self._tensor_keys_to_paths = tensor_keys_to_paths
    self._dataset_has_cache_misses = collections.defaultdict(bool)
    self._num_encode_cache_nodes = 0
    self._num_decode_cache_nodes = 0
    self.cache_output_nodes = cache_output_nodes
    self._num_phases = num_phases
Init method for _OptimizeVisitor.

    Args:
      dataset_keys: An iterable of strings which are keys for a partitioned
        dataset.
      cache_dict: A dictionary of input cache that can be used in place of a
        cacheable accumulate operation. A dictionary from dataset_keys to
        dictionaries of cache keys to PCollections. This can be None if there is
        no cache.
      tensor_keys_to_paths: A dictionary from a tensor key to a unique TF graph
        path hash.
      cache_output_nodes: A dictionary from (dataset_key, cache_key) to encoded
        cache ValueNode. This is the output cache for this graph.
      num_phases: The number of phases of analysis.
    
tensorflow_transform/beam/analysis_graph_builder.py