
    AVh
                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ  ej                  dg 	      dd
       Zy)zConfig functions for TF NumPy.    )ops)weak_tensor_ops)	np_dtypes)np_math_ops)
tf_logging)	tf_exportz5experimental.numpy.experimental_enable_numpy_behavior)v1c                     |dk(  s|dk(  rt        j                  d       t        j                  |       t        j                          t        j                          t        j                  |        y)a  Enable NumPy behavior on Tensors.

  Enabling NumPy behavior has three effects:
  * It adds to `tf.Tensor` some common NumPy methods such as `T`,
    `reshape` and `ravel`.
  * It changes dtype promotion in `tf.Tensor` operators to be
    compatible with NumPy. For example,
    `tf.ones([], tf.int32) + tf.ones([], tf.float32)` used to throw a
    "dtype incompatible" error, but after this it will return a
    float64 tensor (obeying NumPy's promotion rules).
  * It enhances `tf.Tensor`'s indexing capability to be on par with
    [NumPy's](https://numpy.org/doc/stable/reference/arrays.indexing.html).

  Args:
    prefer_float32: Controls whether dtype inference will use float32 for Python
      floats, or float64 (the default and the NumPy-compatible behavior).
    dtype_conversion_mode: a string that specifies promotion mode. This string
      corresponds to a PromoMode Enum and can be 'off', 'legacy', 'safe', or
      'all'. 'safe' or 'all' mode enables the auto dtype conversion semantics.
  safeallzUserWarning: enabling the new type promotion must happen at the beginning of the program. Please ensure no TF APIs have been used yet.N)	r   warningr   set_dtype_conversion_modeenable_numpy_style_slicingr   enable_numpy_methods_on_tensorr   set_prefer_float32)prefer_float32dtype_conversion_modes     Y/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/numpy_ops/np_config.pyenable_numpy_behaviorr      s^    0 f$(=(F	
  56  ",,.~.    N)Flegacy)__doc__tensorflow.python.frameworkr   tensorflow.python.opsr   tensorflow.python.ops.numpy_opsr   r   tensorflow.python.platformr   tensorflow.python.utilr   r    r   r   <module>r      sB    % + 1 5 7 1 , ;//r   