
    BVh0                     >    d Z ddlmZ ddlmZ ddlmZ d Zd Zd Z	y)	z+Exception handling statements: assert, etc.    )tensor_util)control_flow_assert)
tf_inspectc                    t        |      st        dj                  |            t        j                  |      \  }}}}|s|rt        dj                  |            t        j                  |       rt        | |      S t        | |      S )a,  Functional form of an assert statement.

  This follows the semantics of the Python assert statement, however the
  concrete implementations may deviate from it. See the respective
  implementation for details.

  In general, the assert statement should not be used for control flow.
  Furthermore, it is encouraged that the assertion expressions should not have
  side effects.

  Args:
    expression1: Any
    expression2: Callable[[], Any], returns the expression to include in the
        error message when expression1 evaluates to False. When expression1 is
        True, the result of expression2 will not be evaluated, however,
        expression2 itself may be evaluated in some implementations.

  Returns:
    Any, implementation-dependent.

  Raises:
    ValueError: if any arguments are illegal.
  z{} must be a callablez{} may not have any arguments)	callable
ValueErrorformatr   
getargspecr   
is_tf_type_tf_assert_stmt_py_assert_stmt)expression1expression2args_keywordss        `/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/autograph/operators/exceptions.pyassert_stmtr      s    0 
+	
,33K@
AA#..{;$8Q	X
4;;KH
IIK(;44;44    c                 b     |       }t        |t              s|g}t        j                  | |      S )a  Overload of assert_stmt that stages a TF Assert.

  This implementation deviates from Python semantics as follows:
    (1) the assertion is verified regardless of the state of __debug__
    (2) on assertion failure, the graph execution will fail with
        tensorflow.errors.ValueError, rather than AssertionError.

  Args:
    expression1: tensorflow.Tensor, must evaluate to a tf.bool scalar
    expression2: Callable[[], Union[tensorflow.Tensor, List[tensorflow.Tensor]]]

  Returns:
    tensorflow.Operation
  )
isinstancelistr   Assert)r   r   expression2_tensorss      r   r   r   :   s4     $	'	../		#	#K1D	EEr   c                      | sJ  |              y)z@Overload of assert_stmt that executes a Python assert statement.N )r   r   s     r   r   r   O   s    	#km#	r   N)
__doc__tensorflow.python.frameworkr   tensorflow.python.opsr   tensorflow.python.utilr   r   r   r   r   r   r   <module>r!      s$    2 3 5 -!5HF*r   