
    AVh$                        d Z ddl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 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 ddlmZm Z m!Z! ddl"m#Z# dde$de%fdZ&  ed       ejN                  e&            Z(de$de%fdZ)dde$fdZ*  ed       ejN                  e*            Z+de$fdZ,dde$fdZ-  ed       ejN                  e-            Z.de$fdZ/y)zUPython wrappers around TensorFlow ops.

This file is MACHINE GENERATED! Do not edit.
    N)
pywrap_tfe)context)core)execute)dtypes)annotation_types)op_def_registry)ops)op_def_library)deprecated_endpoints)dispatch)	tf_export)TypeVarListAny)	Annotatedtokenis_asyncc                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S t        j                  |d      }t        |t         t"        f      st%        d|z        |D 	cg c]  }	t        j&                  |	d       }}	|d}t        j(                  |d      }t+        j,                  d| ||||	      \  }
}
}}|dd }|s|S t        j.                         rjd|j1                  d      d|j3                  d      d
|j1                  d
      d|j1                  d      f}|j4                  }t        j6                  d|||       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||      S # t        j                  $ r Y w xY wc c}	w )a  Eagerly executes a python function to compute func(input)->output. The

  semantics of the input, output, and attributes are the same as those for
  PyFunc.

  Args:
    input: A list of `Tensor` objects.
    token: A `string`.
    Tout: A list of `tf.DTypes`.
    is_async: An optional `bool`. Defaults to `False`.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `Tout`.
  EagerPyFuncr   r   ToutN)r   r   r   namectx@Expected list for 'Tout' argument to 'eager_py_func' Op, not %r.F)inputr   r   r   r   Tin)_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackExceptioneager_py_func_eager_fallback_SymbolicException_executemake_str
isinstancelisttuple	TypeError	make_type	make_bool_op_def_library_apply_op_helpermust_record_gradientget_attr_get_attr_boolinputsrecord_gradient)r   r   r   r   r   _ctxtld_resulte_t__op_outputs_attrs_inputs_flats                  T/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_script_ops.pyeager_py_funcrB      s     
			0h..0$#\\11mT5'5*&$ g n 

E7
+%	D4-	(
	&(,	-. . 48	8R(

R
(	8$	8H*5('88U%dX "!QX QK'	J""$s||G,j  ,eS\\%5Hcll6*,F ::L|VW6	.C && -
##At,,## 
)
uxd  ## 
 
9s6    F  G6 GF..GGG G32G3zraw_ops.EagerPyFuncc                    t        j                  |d      }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|d}t        j                  |d      }t        j                  | |      \  }} t        |       }d|d|d|d|f}	t        j                  dt        |      ||	||      }
t        j                         rt        j                  d	||	|
       |
S c c}w )
Nr   r   r   Fr   r   s   EagerPyFuncr5   attrsr   r   r   )r(   r)   r*   r+   r,   r-   r.   r/   convert_to_mixed_eager_tensorsr   lenr2   r6   )r   r   r   r   r   r   r;   	_attr_Tinr@   r?   r9   s              rA   r&   r&   W   s   


E7
+%	D4-	(
	&(,	-. . 48	8R(

R
(	8$	8H*5(<<UCH)Ue,UJ%F&^SY|#)s?'""$|VW6	. 
9s   C8c           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S t        j                  |d      }t        |t         t"        f      st%        d|z        |D cg c]  }t        j&                  |d       }}t)        j*                  d| |||      \  }	}	}
}|dd }|s|
S t        j,                         rYd|
j/                  d      d|
j/                  d      d|
j/                  d      f}|
j0                  }t        j2                  d|||       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y ew xY wc c}w )	aU  Invokes a python function to compute func(input)->output.

  This operation is considered stateful. For a stateless version, see
  PyFuncStateless.

  Args:
    input: A list of `Tensor` objects.
      List of Tensors that will provide input to the Op.
    token: A `string`.
      A token representing a registered python function in this address space.
    Tout: A list of `tf.DTypes`. Data types of the outputs from the op.
      The length of the list specifies the number of outputs.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `Tout`.
  PyFuncr   r   Nr   r   r   r   :Expected list for 'Tout' argument to 'py_func' Op, not %r.r   r   r   r   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%   py_func_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   r0   r1   r2   r3   r5   r6   r   r   r   r   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   s                 rA   py_funcrP   m   s   $ 
			0h..0$#\\11heWeVTCgn 

E7
+%	D4-	(
	 "&	'( ( 48	8R(

R
(	8$	8'88UDB!QXQK'	J""$s||G,eS\\%5Hcll6*,F::L,1	.7 && -
##At,,## 
#
u4d> >## 
 
9s6    E GF%F  FFF- -GGzraw_ops.PyFuncc                    t        j                  |d      }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  | |      \  }} t        |       }d|d|d|f}t        j                  dt        |      ||||      }	t        j                         rt        j                  d|||	       |	S c c}w )Nr   rL   r   r   s   PyFuncrD   rJ   r(   r)   r*   r+   r,   r-   r.   rF   r   rG   r2   r6   
r   r   r   r   r   r;   rH   r@   r?   r9   s
             rA   rN   rN      s    


E7
+%	D4-	(
	 "&	'( ( 48	8R(

R
(	8$	8<<UCH)Ue,UE9fd;&YD	,#)s?'""$,1	. 
9   Cc           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S t        j                  |d      }t        |t         t"        f      st%        d|z        |D cg c]  }t        j&                  |d       }}t)        j*                  d| |||      \  }	}	}
}|dd }t        j,                         rYd|
j/                  d      d|
j/                  d      d|
j/                  d      f}|
j0                  }t        j2                  d|||       |S # t        j                  $ r }t        j                  ||       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | ||||      S # t        j                  $ r Y aw xY wc c}w )	zA stateless version of PyFunc.

  Args:
    input: A list of `Tensor` objects.
    token: A `string`.
    Tout: A list of `tf.DTypes`.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `Tout`.
  PyFuncStatelessr   r   NrK   DExpected list for 'Tout' argument to 'py_func_stateless' Op, not %r.rM   r   )r   r   r   r   r   r    r!   r"   r#   r$   r%    py_func_stateless_eager_fallbackr'   r(   r)   r*   r+   r,   r-   r.   r0   r1   r2   r3   r5   r6   rO   s                 rA   py_func_statelessrY      s    
			0h..0$#\\11ugufdLgn 

E7
+%	D4-	(
	*,0	12 2 48	8R(

R
(	8$	8'88e$TK!QXQK'""$s||G,eS\\%5Hcll6*,F::L<:	.3 && -
##At,,## 
-
u4d> >## 
 
9s6    E GF!E<<FFF) )G ?G zraw_ops.PyFuncStatelessc                    t        j                  |d      }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  | |      \  }} t        |       }d|d|d|f}t        j                  dt        |      ||||      }	t        j                         rt        j                  d|||	       |	S c c}w )Nr   rW   r   r   s   PyFuncStatelessrD   rV   rR   rS   s
             rA   rX   rX      s    


E7
+%	D4-	(
	*,0	12 2 48	8R(

R
(	8$	8<<UCH)Ue,UE9fd;&/T$0C"&(' ""$<:	. 
9rT   )FN)N)0__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r   r   r!   r   r(   tensorflow.python.frameworkr   _dtypestensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r#   r   r0   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   	_dispatch tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   strboolrB   	to_raw_opr   r&   rP   rJ   rN   rY   rV   rX        rA   <module>ro      s   
  6 7 1 7 9 F K 3 I C 8 6 % % '9 9D 9v /i-.~t~~m/LMs D ,4# 4l 
%#	$^T^^G%<	= $,C ,\ 7)56~t~~FW7XY3 rn   