
    BVh!                     4    d Z ddlmZ ddlmZ ddlmZ ddZy)zTest utilities for tf.signal.    )
config_pb2)tf_optimizer)saverNc                    |/t        j                         }d|j                  j                  _        ||D ]  }| j                  d|        t        j                  | j                               }t        j                  ||      S )a  Tries to optimize the provided graph using grappler.

  Args:
    graph: A `tf.Graph` instance containing the graph to optimize.
    fetches: An optional list of `Tensor`s to fetch (i.e. not optimize away).
      Grappler uses the 'train_op' collection to look for fetches, so if not
      provided this collection should be non-empty.
    config_proto: An optional `tf.compat.v1.ConfigProto` to use when rewriting
      the graph.

  Returns:
    A `tf.compat.v1.GraphDef` containing the rewritten graph.
  train_op)	graph_def)r   ConfigProtograph_optionsrewrite_optionsmin_graph_nodesadd_to_collectionr   export_meta_graphas_graph_defr   OptimizeGraph)graphfetchesconfig_protofetch	metagraphs        _/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/kernel_tests/signal/test_util.pygrappler_optimizer      s}     ))+LACL..> 1j%01%%0B0B0DE)		#	#L)	<<    )NN)__doc__tensorflow.core.protobufr   tensorflow.python.grapplerr   tensorflow.python.trainingr   r    r   r   <module>r      s    $ / 3 ,=r   