
    BVh                         d Z ddlZddlZddlZddlmZ ddlmZ dZ	dZ
dada eed      s	 eed      rd	a ed
      dd       Z ed      d        Zd Zd Zd Zd Zd Zd Zy)z Logging and debugging utilities.    N)
tf_logging)	tf_exportAUTOGRAPH_VERBOSITYFps1ps2Tzautograph.set_verbosityc                     | a |ay)a  Sets the AutoGraph verbosity level.

  _Debug logging in AutoGraph_

  More verbose logging is useful to enable when filing bug reports or doing
  more in-depth debugging.

  There are two means to control the logging verbosity:

   * The `set_verbosity` function

   * The `AUTOGRAPH_VERBOSITY` environment variable

  `set_verbosity` takes precedence over the environment variable.

  For example:

  ```python
  import os
  import tensorflow as tf

  os.environ['AUTOGRAPH_VERBOSITY'] = '5'
  # Verbosity is now 5

  tf.autograph.set_verbosity(0)
  # Verbosity is now 0

  os.environ['AUTOGRAPH_VERBOSITY'] = '1'
  # No effect, because set_verbosity was already called.
  ```

  Logs entries are output to [absl](https://abseil.io)'s
  [default output](https://abseil.io/docs/python/guides/logging),
  with `INFO` level.
  Logs can be mirrored to stdout by using the `alsologtostdout` argument.
  Mirroring is enabled by default when Python runs in interactive mode.

  Args:
    level: int, the verbosity level; larger values specify increased verbosity;
      0 means no logging. When reporting bugs, it is recommended to set this
      value to a larger number, like 10.
    alsologtostdout: bool, whether to also output log messages to `sys.stdout`.
  N)verbosity_levelecho_log_to_stdout)levelalsologtostdouts     \/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/autograph/utils/ag_logging.pyset_verbosityr   $   s    ^ /&    zautograph.tracec                      t        |   y)a{  Traces argument information at compilation time.

  `trace` is useful when debugging, and it always executes during the tracing
  phase, that is, when the TF graph is constructed.

  _Example usage_

  ```python
  import tensorflow as tf

  for i in tf.range(10):
    tf.autograph.trace(i)
  # Output: <Tensor ...>
  ```

  Args:
    *args: Arguments to print to `sys.stdout`.
  N)print)argss    r   tracer   W   s    ( ,r   c                  h    t         t         S t        t        j                  t        t
                    S N)r	   intosgetenvVERBOSITY_VAR_NAMEDEFAULT_VERBOSITY r   r   get_verbosityr   n   s&     	RYY)+<=	>>r   c                     t               | k\  S r   )r   )r   s    r   has_verbosityr   u   s    	E	!!r   c                 n    t        | |z         |j                  dd      rt        j                          y y )Nexc_infoF)r   get	traceback	print_excmsgr   kwargss      r   _output_to_stdoutr'   y   s-    d
ZZ
E" #r   c                     t        |       r3t        j                  |g|i | t        rt	        d|z   g|i | y y y )NzERROR: )r   loggingerrorr
   r'   r   r%   r   r&   s       r   r*   r*      sC    5MM#'''	C9$9&9  r   c                 z    t        |       r0t        j                  |g|i | t        rt	        |g|i | y y y r   )r   r)   infor
   r'   r+   s       r   logr.      s?    5LL&t&v&-d-f-  r   c                     t        j                  | g|i | t        r1t        d| z   g|i | t        j
                  j                          y y )Nz	WARNING: )r)   warningr
   r'   sysstdoutflushr$   s      r   r0   r0      sG    	//#'''kC'9$9&9JJ r   )F)__doc__r   r1   r"   tensorflow.python.platformr   r)    tensorflow.python.util.tf_exportr   r   r   r	   r
   hasattrr   r   r   r   r'   r*   r.   r0   r   r   r   <module>r8      s    ' 	 
  = 6*    3'#u- $%/' &/'d  ,?":.r   