
    AVh
                         d Z ddlmZ ddlmZ ddlmZ ddlm	Z	  e	dg      d        Z
 e	d	g      d
        Z e	dg      d        Zy)z!API for enabling v2 control flow.    )ops)control_flow_util)
tf_logging)	tf_exportenable_control_flow_v2)v1c                      t        j                  dd       t        j                  j	                         j                  d       dt        _        y)a  Use control flow v2.

  control flow v2 (cfv2) is an improved version of control flow in TensorFlow
  with support for higher order derivatives. Enabling cfv2 will change the
  graph/function representation of control flow, e.g., `tf.while_loop` and
  `tf.cond` will generate functional `While` and `If` ops instead of low-level
  `Switch`, `Merge` etc. ops. Note: Importing and running graphs exported
  with old control flow will still be supported.

  Calling tf.enable_control_flow_v2() lets you opt-in to this TensorFlow 2.0
  feature.

  Note: v2 control flow is always enabled inside of tf.function. Calling this
  function is not required.
     zEnabling control flow v2TNloggingvlogr   _control_flow_api_gaugeget_cellsetr   ENABLE_CONTROL_FLOW_V2     ]/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/control_flow_v2_toggles.pyr   r      s9    $ 
,,q,-&&(,,T2-1*r   disable_control_flow_v2c                      t        j                  dd       t        j                  j	                         j                  d       dt        _        y)zOpts out of control flow v2.

  Note: v2 control flow is always enabled inside of tf.function. Calling this
  function has no effect in that case.

  If your code needs tf.disable_control_flow_v2() to be called to work
  properly please file a bug.
  r
   zDisabling control flow v2FNr   r   r   r   r   r   /   s9     
,,q-.&&(,,U3-2*r   control_flow_v2_enabledc                  P    t        j                  t        j                               S )zrReturns `True` if v2 control flow is enabled.

  Note: v2 control flow is always enabled inside of tf.function.
  )r   EnableControlFlowV2r   get_default_graphr   r   r   r   r   ?   s     
	.	.s/D/D/F	GGr   N)__doc__tensorflow.python.frameworkr   tensorflow.python.opsr   tensorflow.python.platformr   r    tensorflow.python.util.tf_exportr   r   r   r   r   r   r   <module>r       so     ( + 3 < 6 '()2 *2, ()*3 +3 ()*H +Hr   