
    BVh
                     N    d Z ddlZddlmZ dgZej
                  gZd Zd Zd Z	y)z5Helpers to traverse the Dataset dependency structure.    N)dtypesDummyIterationCounterc                    g }t        j                         }|j                  | j                  j                         g }|j                         s~|j                         }|j                  |        ||      r|j                  |       |j                  D ]$  }|j                  }||vs|j                  |       & |j                         s~|S )zBTraverse a dataset graph, returning nodes matching `op_filter_fn`.)	queueQueueput_variant_tensoropemptygetappendinputs)datasetop_filter_fnresultbfs_qvisitedr
   iinput_ops           T/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/data/util/traverse.py	_traverser      s    &
++-%))G##&&''KKM	BNN2BmmBYY h		 		( KKM 
-    c                      d }t        | |      S )aH  Given an input dataset, finds all allowlisted ops used for construction.

  Allowlisted ops are stateful ops which are known to be safe to capture by
  value.

  Args:
    dataset: Dataset to find allowlisted stateful ops for.

  Returns:
    A list of variant_tensor producing dataset ops used to construct this
    dataset.
  c                 h    | j                   d   j                  t        v xs | j                  t        v S Nr   )outputsdtypeTENSOR_TYPES_ALLOWLISTtypeOP_TYPES_ALLOWLISTr
   s    r   capture_by_valuez5obtain_capture_by_value_ops.<locals>.capture_by_value<   s0    JJqM#99 *GG))+r   r   )r   r"   s     r   obtain_capture_by_value_opsr$   .   s    + 
7,	--r   c                     t        | d       S )a  Given an input dataset, finds all dataset ops used for construction.

  A series of transformations would have created this dataset with each
  transformation including zero or more Dataset ops, each producing a dataset
  variant tensor. This method outputs all of them.

  Args:
    dataset: Dataset to find variant tensors for.

  Returns:
    A list of variant_tensor producing dataset ops used to construct this
    dataset.
  c                 V    | j                   d   j                  t        j                  k(  S r   )r   r   r   variantr!   s    r   <lambda>z/obtain_all_variant_tensor_ops.<locals>.<lambda>Q   s    rzz!}':':fnn'L r   r#   )r   s    r   obtain_all_variant_tensor_opsr)   C   s     
7L	MMr   )
__doc__r   tensorflow.python.frameworkr   r    r'   r   r   r$   r)    r   r   <module>r-      s:    <  . ..  !..) $.*Nr   