ó
V¾÷Xc        	   @` sË  d  Z  d d l m Z d d l m Z d d l m Z d d l Z d d l Z d d l m Z d d l	 m
 Z d d l m Z d	 d
 d d d d d d d g	 Z d „  Z d e f d „  ƒ  YZ d „  Z d d „ Z e d „ Z d „  Z d e d „ Z e e e d „ Z d „  Z e e e d „ Z d „  Z d „  Z  d e f d „  ƒ  YZ! d  „  Z" d! „  Z# d" „  Z$ d d d# „ Z% d d$ „ Z& d d d% „ Z' e j( d& ƒ Z) d' „  Z* d( d( d) „ Z+ d( d( d* „ Z, d S(+   s'   Utility funtions for the graph_editor.
i    (   t   absolute_import(   t   division(   t   print_functionN(   t	   iteritems(   t   ops(   t	   array_opst   make_list_of_opt   get_tensorst   make_list_of_tt   get_generating_opst   get_consuming_opst   ControlOutputst   placeholder_namet   make_placeholder_from_tensort%   make_placeholder_from_dtype_and_shapec         C` s1   x* | D]" } | |  k r |  j  | ƒ q q W|  S(   s?   Add all the elements of lb in la if they are not there already.(   t   append(   t   lat   lbt   l(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   concatenate_unique)   s    t   ListViewc           B` sJ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z e Z d „  Z d „  Z	 RS(   sY   Immutable list wrapper.

  This class is strongly inspired by the one in tf.Operation.
  c         C` s:   t  | t ƒ s- t d j t | ƒ ƒ ƒ ‚ n  | |  _ d  S(   Ns   Expected a list, got: {}.(   t
   isinstancet   listt	   TypeErrort   formatt   typet   _list(   t   selft   list_(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   __init__8   s    c         C` s   t  |  j ƒ S(   N(   t   iterR   (   R   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   __iter__=   s    c         C` s   t  |  j ƒ S(   N(   t   lenR   (   R   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   __len__@   s    c         C` s   t  |  j ƒ S(   N(   t   boolR   (   R   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   __bool__C   s    c         C` s   |  j  | S(   N(   R   (   R   t   i(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   __getitem__I   s    c         C` s,   t  | t ƒ s t | ƒ } n  t |  ƒ | S(   N(   R   R   (   R   t   other(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   __add__L   s    (
   t   __name__t
   __module__t   __doc__R   R   R!   R#   t   __nonzero__R%   R'   (    (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   2   s   					c         C` s)   y t  |  ƒ } Wn t k
 r$ t SXt S(   s&   Return true if the object is iterable.(   R   t	   Exceptiont   Falset   True(   t   objt   _(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   is_iterableS   s
    c         C` s   | d k r g  } n  t |  t ƒ rQ xd t |  ƒ D] \ } } t | | ƒ q1 Wn: t |  ƒ r~ x+ |  D] } t | | ƒ qd Wn | j |  ƒ | S(   s  Flatten a tree into a list.

  Args:
    tree: iterable or not. If iterable, its elements (child) can also be
      iterable or not.
    leaves: list to which the tree leaves are appended (None by default).
  Returns:
    A list of all the leaves in the tree.
  N(   t   NoneR   t   dictR   t   flatten_treeR1   R   (   t   treet   leavesR0   t   child(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR4   \   s    
	c         ` s>  t  |  ƒ r0t |  t ƒ rW |  j t |  ƒ ƒ } | j ‡  f d †  t |  ƒ Dƒ ƒ | St |  t ƒ rË t |  d ƒ rŸ |  j t |  ƒ t	 |  j
 ƒ  ˆ  ƒ  } n( |  j t |  ƒ ‡  f d †  |  Dƒ ƒ } | St |  t j ƒ r|  j t |  ƒ ƒ } | j ‡  f d †  |  Dƒ ƒ | S| ‡  f d †  |  Dƒ ƒ Sn
 ˆ  |  ƒ Sd S(   sµ  Transform all the nodes of a tree.

  Args:
    tree: iterable or not. If iterable, its elements (child) can also be
      iterable or not.
    fn: function to apply to each leaves.
    iterable_type: type use to construct the resulting tree for unknwon
      iterable, typically `list` or `tuple`.
  Returns:
    A tree whose leaves has been transformed by `fn`.
    The hierarchy of the output tree mimics the one of the input tree.
  c         3` s*   |  ]  \ } } | t  | ˆ  ƒ f Vq d  S(   N(   t   transform_tree(   t   .0t   kR7   (   t   fn(    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pys	   <genexpr>„   s    t   _asdictc         3` s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   R8   (   R9   R7   (   R;   (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pys	   <genexpr>Œ   s    c         3` s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   R8   (   R9   R7   (   R;   (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pys	   <genexpr>   s    c         3` s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   R8   (   R9   R7   (   R;   (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pys	   <genexpr>“   s    N(   R1   R   R3   t   __new__R   R   R   t   tuplet   hasattrR8   R<   t   collectionst   Sequence(   R5   R;   t   iterable_typet   res(    (   R;   sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR8   s   s$    *c          G` s„   d } xw t |  ƒ D]i \ } } | d k rF | j d k	 rF | j } q | j d k	 r | j | k	 r t d j | ƒ ƒ ‚ q q Wd S(   sÎ   Check that all the element in args belong to the same graph.

  Args:
    *args: a list of object with a obj.graph property.
  Raises:
    ValueError: if all the elements do not belong to the same graph.
  s   Argument[{}]: Wrong graph!N(   R2   t	   enumeratet   grapht
   ValueErrorR   (   t   argsRE   R$   t   sgv(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   check_graphs˜   s    c         C` sG  t  |  t j ƒ r |  St |  ƒ s@ t d j t |  ƒ ƒ ƒ ‚ n  | d k ra t j t j	 f } n t | ƒ sy | f } n  d } xŸ |  D]— } t  | | ƒ sÞ t d j d j
 g  | D] } t | ƒ ^ q± ƒ t | ƒ ƒ ƒ ‚ n  | d k rö | j } q† | | j k	 r† t d j | ƒ ƒ ‚ q† q† W| d k rC| rCt d ƒ ‚ n  | S(   s8  Return the unique graph used by the all the elements in tops.

  Args:
    tops: list of elements to check (usually a list of tf.Operation and/or
      tf.Tensor). Or a tf.Graph.
    check_types: check that the element in tops are of given type(s). If None,
      the types (tf.Operation, tf.Tensor) are used.
    none_if_empty: don't raise an error if tops is an empty list, just return
      None.
  Returns:
    The unique graph used by all the tops.
  Raises:
    TypeError: if tops is not a iterable of tf.Operation.
    ValueError: if the graph is not unique.
  s   {} is not iterables    Expected a type in ({}), got: {}s   , s+   Operation {} does not belong to given graphs,   Can't find the unique graph of an empty listN(   R   t   tf_opst   GraphR1   R   R   R   R2   t	   Operationt   Tensort   joint   strRE   RF   (   t   topst   check_typest   none_if_emptyt   gt   opt   t(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   get_unique_graph¨   s(    1c         C` s®   t  |  t j ƒ r1 | r" |  j ƒ  St d ƒ ‚ ny t |  ƒ sI |  g }  n  |  sS g  S| r | re d n t j } t |  d | ƒn  g  |  D] } t  | t j ƒ rˆ | ^ qˆ Sd S(   s2  Convert ops to a list of `tf.Operation`.

  Args:
    ops: can be an iterable of `tf.Operation`, a `tf.Graph` or a single
      operation.
    check_graph: if `True` check if all the operations belong to the same graph.
    allow_graph: if `False` a `tf.Graph` cannot be converted.
    ignore_ts: if True, silently ignore `tf.Tensor`.
  Returns:
    A newly created list of `tf.Operation`.
  Raises:
    TypeError: if ops cannot be converted to a list of `tf.Operation` or,
     if `check_graph` is `True`, if all the ops do not belong to the
     same graph.
  s0   allow_graph is False: cannot convert a tf.Graph.RQ   N(	   R   RJ   RK   t   get_operationsR   R1   R2   RL   RV   (   R   t   check_grapht   allow_grapht	   ignore_tsRQ   RT   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   Î   s    
c         C` s^   t  |  t j ƒ s0 t d j t |  ƒ ƒ ƒ ‚ n  g  } x! |  j ƒ  D] } | | j 7} qC W| S(   sÆ   get all the tensors which are input or output of an op in the graph.

  Args:
    graph: a `tf.Graph`.
  Returns:
    A list of `tf.Tensor`.
  Raises:
    TypeError: if graph is not a `tf.Graph`.
  s   Expected a graph, got: {}(   R   RJ   RK   R   R   R   RW   t   outputs(   RE   t   tsRT   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   ï   s    
c         C` s®   t  |  t j ƒ r1 | r" t |  ƒ St d ƒ ‚ ny t |  ƒ sI |  g }  n  |  sS g  S| r | re d n t j } t |  d | ƒn  g  |  D] } t  | t j ƒ rˆ | ^ qˆ Sd S(   s  Convert ts to a list of `tf.Tensor`.

  Args:
    ts: can be an iterable of `tf.Tensor`, a `tf.Graph` or a single tensor.
    check_graph: if `True` check if all the tensors belong to the same graph.
    allow_graph: if `False` a `tf.Graph` cannot be converted.
    ignore_ops: if `True`, silently ignore `tf.Operation`.
  Returns:
    A newly created list of `tf.Tensor`.
  Raises:
    TypeError: if `ts` cannot be converted to a list of `tf.Tensor` or,
     if `check_graph` is `True`, if all the ops do not belong to the same graph.
  s0   allow_graph is False: cannot convert a tf.Graph.RQ   N(	   R   RJ   RK   R   R   R1   R2   RM   RV   (   R\   RX   RY   t
   ignore_opsRQ   RU   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR     s    
c         C` s,   t  |  d t ƒ}  g  |  D] } | j ^ q S(   s  Return all the generating ops of the tensors in `ts`.

  Args:
    ts: a list of `tf.Tensor`
  Returns:
    A list of all the generating `tf.Operation` of the tensors in `ts`.
  Raises:
    TypeError: if `ts` cannot be converted to a list of `tf.Tensor`.
  RY   (   R   R-   RT   (   R\   RU   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR	     s    
c         C` s`   t  |  d t ƒ}  g  } xA |  D]9 } x0 | j ƒ  D]" } | | k r2 | j | ƒ q2 q2 Wq W| S(   sû   Return all the consuming ops of the tensors in ts.

  Args:
    ts: a list of `tf.Tensor`
  Returns:
    A list of all the consuming `tf.Operation` of the tensors in `ts`.
  Raises:
    TypeError: if ts cannot be converted to a list of `tf.Tensor`.
  RY   (   R   R-   t	   consumersR   (   R\   R   RU   RT   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR
   -  s    
c           B` sJ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d „  ƒ Z	 RS(   s   The control outputs topology.c         C` sY   t  | t j ƒ s0 t d j t | ƒ ƒ ƒ ‚ n  i  |  _ | |  _ d |  _	 |  j
 ƒ  d S(   se  Create a dictionary of control-output dependencies.

    Args:
      graph: a `tf.Graph`.
    Returns:
      A dictionary where a key is a `tf.Operation` instance and the
         corresponding value is a list of all the ops which have the key
         as one of their control-input dependencies.
    Raises:
      TypeError: graph is not a `tf.Graph`.
    s   Expected a tf.Graph, got: {}N(   R   RJ   RK   R   R   R   t   _control_outputst   _graphR2   t   _versiont   _build(   R   RE   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   C  s    			c         C` s&   |  j  |  j j k r" |  j ƒ  n  |  S(   s4   Update the control outputs if the graph has changed.(   Ra   R`   t   versionRb   (   R   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   updateV  s    c         C` s   |  j  j ƒ  |  j j ƒ  } xk | D]c } xZ | j D]O } | |  j  k rX g  |  j  | <n  | |  j  | k r3 |  j  | j | ƒ q3 q3 Wq# W|  j j |  _ d S(   s%   Build the control outputs dictionary.N(   R_   t   clearR`   RW   t   control_inputsR   Rc   Ra   (   R   R   RT   t   control_input(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyRb   \  s    c         C` s   |  j  S(   N(   R_   (   R   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   get_allh  s    c         C` s"   | |  j  k r |  j  | Sd Sd S(   s!   return the control outputs of op.N(    (   R_   (   R   RT   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   getk  s    c         C` s   |  j  S(   N(   R`   (   R   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyRE   r  s    (
   R(   R)   R*   R   Rd   Rb   Rh   Ri   t   propertyRE   (    (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   @  s   					c         C` s'   |  r# |  d d k r# |  d 7}  n  |  S(   Niÿÿÿÿt   /(    (   t   scope(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   scope_finalizew  s    c         C` s+   |  j  d ƒ } | d k r d S|  | d  S(   NRk   iÿÿÿÿt    i   (   t   rfind(   Rl   t   slash(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   scope_dirname}  s    c         C` s+   |  j  d ƒ } | d k r |  S|  | d S(   NRk   iÿÿÿÿi   (   Ro   (   Rl   Rp   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   scope_basename„  s    c         C` sæ   | d k	 r t | ƒ } n  |  d k	 rÅ t |  t j ƒ sW t d j t |  ƒ ƒ ƒ ‚ n  t |  j	 j
 ƒ } t |  j	 j
 ƒ } | d k r | } n  | j d ƒ r¨ | } n d j | |  j ƒ } | | S| d k rÚ d } n  | d Sd S(   s4  Create placeholder name for the graph editor.

  Args:
    t: optional tensor on which the placeholder operation's name will be based
      on
    scope: absolute scope with which to prefix the placeholder's name. None
      means that the scope of t is preserved. "" means the root scope.
  Returns:
    A new placeholder name prefixed by "geph". Note that "geph" stands for
      Graph Editor PlaceHolder. This convention allows to quickly identify the
      placeholder generated by the Graph Editor.
  Raises:
    TypeError: if t is not None or a tf.Tensor.
  s   Expected a tf.Tenfor, got: {}t   geph__s   geph__{}_{}Rn   t   gephN(   R2   Rm   R   RJ   RM   R   R   R   Rq   RT   t   nameRr   t
   startswitht   value_index(   RU   Rl   t
   op_dirnamet   op_basenamet   ph_name(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   ‹  s     			c      
   C` s1   t  j d |  j d |  j ƒ  d t |  d | ƒƒ S(   sö  Create a `tf.placeholder` for the Graph Editor.

  Note that the correct graph scope must be set by the calling function.

  Args:
    t: a `tf.Tensor` whose name will be used to create the placeholder
      (see function placeholder_name).
    scope: absolute scope within which to create the placeholder. None
      means that the scope of `t` is preserved. `""` means the root scope.
  Returns:
    A newly created `tf.placeholder`.
  Raises:
    TypeError: if `t` is not `None` or a `tf.Tensor`.
  t   dtypet   shapeRu   Rl   (   t   tf_array_opst   placeholderR{   t	   get_shapeR   (   RU   Rl   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   °  s    	c      	   C` s%   t  j d |  d | d t d | ƒ ƒ S(   sà  Create a tf.placeholder for the Graph Editor.

  Note that the correct graph scope must be set by the calling function.
  The placeholder is named using the function placeholder_name (with no
  tensor argument).

  Args:
    dtype: the tensor type.
    shape: the tensor shape (optional).
    scope: absolute scope within which to create the placeholder. None
      means that the scope of t is preserved. "" means the root scope.
  Returns:
    A newly created tf.placeholder.
  R{   R|   Ru   Rl   (   R}   R~   R   (   R{   R|   Rl   (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyR   Ä  s    	s	   ^__\w+__$c          C` s;   g  t  t j ƒ D]' }  t j |  ƒ s t t j |  ƒ ^ q S(   s+   Return all the predefined collection names.(   t   dirRJ   t	   GraphKeyst   _INTERNAL_VARIABLE_REt   matcht   getattr(   t   key(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   get_predefined_collection_namesÚ  s    Rn   c         C` sÔ   |  j  } | rX t | ƒ } | j | ƒ sE t d j | | ƒ ƒ ‚ n  | t | ƒ } n  | } | r} t | ƒ } | | } n  t |  t j ƒ rœ | j	 | ƒ St |  t j
 ƒ r» | j | ƒ St d t |  ƒ ƒ ‚ d S(   s  Find corresponding op/tensor in a different graph.

  Args:
    target: A `tf.Tensor` or a `tf.Operation` belonging to the original graph.
    dst_graph: The graph in which the corresponding graph element must be found.
    dst_scope: A scope which is prepended to the name to look for.
    src_scope: A scope which is removed from the original of `target` name.

  Returns:
    The corresponding tf.Tensor` or a `tf.Operation`.

  Raises:
    ValueError: if `src_name` does not start with `src_scope`.
    TypeError: if `target` is not a `tf.Tensor` or a `tf.Operation`
    KeyError: If the corresponding graph element cannot be found.
  s   {} does not start with {}s+   Expected tf.Tensor or tf.Operation, got: {}N(   Ru   Rm   t   startswidthRF   R   R    R   RJ   RM   t   get_tensor_by_nameRL   t   get_operation_by_nameR   R   (   t   targett	   dst_grapht	   dst_scopet	   src_scopet   src_namet   dst_name(    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   find_corresponding_elemà  s    	c         ` s"   ‡  ‡ ‡ f d †  } t  |  | ƒ S(   sQ  Find corresponding ops/tensors in a different graph.

  `targets` is a Python tree, that is, a nested structure of iterable
  (list, tupple, dictionary) whose leaves are instances of
  `tf.Tensor` or `tf.Operation`

  Args:
    targets: A Python tree containing `tf.Tensor` or `tf.Operation`
      belonging to the original graph.
    dst_graph: The graph in which the corresponding graph element must be found.
    dst_scope: A scope which is prepended to the name to look for.
    src_scope: A scope which is removed from the original of `top` name.

  Returns:
    A Python tree containin the corresponding tf.Tensor` or a `tf.Operation`.

  Raises:
    ValueError: if `src_name` does not start with `src_scope`.
    TypeError: if `top` is not a `tf.Tensor` or a `tf.Operation`
    KeyError: If the corresponding graph element cannot be found.
  c         ` s   t  |  ˆ  ˆ ˆ ƒ S(   N(   R   (   t   top(   R‹   RŒ   R   (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   func  s    (   R8   (   t   targetsR‹   RŒ   R   R’   (    (   R‹   RŒ   R   sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   find_corresponding  s    (-   R*   t
   __future__R    R   R   R@   t   ret   sixR   t   tensorflow.python.frameworkR   RJ   t   tensorflow.python.opsR   R}   t   __all__R   t   objectR   R1   R2   R4   R>   R8   RI   R-   RV   R.   R   R   R   R	   R
   R   Rm   Rq   Rr   R   R   R   t   compileR‚   R†   R   R”   (    (    (    sf   /tmp/pip-build-h1VYrz/tensorflow/tensorflow-1.0.1.data/purelib/tensorflow/contrib/graph_editor/util.pyt   <module>   sP   			!		%	&!			7			%	$