o
    ?e$                     @   sH  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  d"de!de"fddZ#ede$e#Z%de!de"fddZ&d#de!fddZ'ede$e'Z(de!fddZ)d#de!fddZ*ede$e*Z+de!fd d!Z,dS )$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ListFtokenis_asyncc                 C   sz  t j pt  }|j}|jrWzt|d|| d|d|d|
}|W S  tjy7 } zt	|| W Y d}~nd}~w tj
y@   Y nw zt| |||||dW S  tjyV   Y nw t|d}t|ttfsjtd| dd	 |D }|du rwd
}t|d}tjd| ||||d\}	}	}
}|dd }|s|
S t rd|
dd|
dd|
dd|
df}|
j}td||| |S )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.c                 S      g | ]}t |d qS r   _executeZ	make_type.0Z_t r   e/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/ops/gen_script_ops.py
<listcomp>@       z!eager_py_func.<locals>.<listcomp>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_SymbolicExceptionr   make_str
isinstancelisttuple	TypeError	make_bool_op_def_library_apply_op_helpermust_record_gradientget_attrZ_get_attr_boolinputsrecord_gradient)r!   r   r   r   r   _ctxtld_resulte__op_outputs_attrs_inputs_flatr   r   r   eager_py_func   sf   


rC   zraw_ops.EagerPyFuncc           
      C   s   t |d}t|ttfstd| dd |D }|d u r d}t |d}t | |\}} t| }d|d|d|d|f}t jd	t	|||||d
}	t 
 rUt d|||	 |	S )Nr   r   c                 S   r   r   r   r   r   r   r   r   \   r    z0eager_py_func_eager_fallback.<locals>.<listcomp>Fr   r"   r   s   EagerPyFuncr8   attrsr   r   r   )r   r.   r/   r0   r1   r2   r3   convert_to_mixed_eager_tensorsr   lenr6   r9   )
r!   r   r   r   r   r   	_attr_TinrB   rA   r<   r   r   r   r,   V   s0   r,   c              
   C   sP  t j pt  }|j}|jrTzt|d|| d|d|}|W S  tjy5 } zt	|| W Y d}~nd}~w tj
y>   Y nw z
t| ||||dW S  tjyS   Y nw t|d}t|ttfsgtd| dd |D }tjd| |||d	\}}}	}
|
dd }|s|	S t rd|	dd
|	d
d|	df}|	j}td||| |S )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.c                 S   r   r   r   r   r   r   r   r      r    zpy_func.<locals>.<listcomp>r!   r   r   r   r"   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   py_func_eager_fallbackr-   r   r.   r/   r0   r1   r2   r4   r5   r6   r7   r8   r9   r!   r   r   r   r:   r;   r<   r=   r>   r?   r@   rA   rB   r   r   r   py_funcl   sX   


rO   zraw_ops.PyFuncc           	      C      t |d}t|ttfstd| dd |D }t | |\}} t| }d|d|d|f}t jdt|||||d}t 	 rGt 
d	||| |S )
Nr   rK   c                 S   r   r   r   r   r   r   r   r      r    z*py_func_eager_fallback.<locals>.<listcomp>r"   r   s   PyFuncrD   rI   r   r.   r/   r0   r1   r2   rF   r   rG   r6   r9   	r!   r   r   r   r   rH   rB   rA   r<   r   r   r   rM      s&   rM   c              
   C   sH  t j pt  }|j}|jrTzt|d|| d|d|}|W S  tjy5 } zt	|| W Y d}~nd}~w tj
y>   Y nw z
t| ||||dW S  tjyS   Y nw t|d}t|ttfsgtd| dd |D }tjd| |||d	\}}}	}
|
dd }t rd|	dd
|	d
d|	df}|	j}td||| |S )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   NrJ   DExpected list for 'Tout' argument to 'py_func_stateless' Op, not %r.c                 S   r   r   r   r   r   r   r   r      r    z%py_func_stateless.<locals>.<listcomp>rL   r"   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+    py_func_stateless_eager_fallbackr-   r   r.   r/   r0   r1   r2   r4   r5   r6   r7   r8   r9   rN   r   r   r   py_func_stateless   sT   


rV   zraw_ops.PyFuncStatelessc           	      C   rP   )
Nr   rT   c                 S   r   r   r   r   r   r   r   r      r    z4py_func_stateless_eager_fallback.<locals>.<listcomp>r"   r   s   PyFuncStatelessrD   rS   rQ   rR   r   r   r   rU      s(   rU   )FN)N)-__doc__collectionsZtensorflow.pythonr   Ztensorflow.python.eagerr   r#   r   r'   r   r   Ztensorflow.python.frameworkr   Z_dtypesZtensorflow.security.fuzzing.pyr   Z_atypesr   Z_op_def_registryr	   r)   r
   r4   Z"tensorflow.python.util.deprecationr   Ztensorflow.python.utilr   	_dispatchZ tensorflow.python.util.tf_exportr   typingr   r   strboolrC   Z	to_raw_opr   r,   rO   rI   rM   rV   rS   rU   r   r   r   r   <module>   s0    ;6.