o
    i e9                     @   s(  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  edej!ej"ej#ej$ej%ej&ej'ej(ej)ej*ej+ej,ej-ej.ej/ej0ej1ej2ej3ej4ej5ej6ej7ej8Z9ej:ej;edd#dej<e9 dej<e9 fddZ=ede>e=Z?e=j@jAZBdej<e9 dej<e9 fddZCej:ej;edd#de ej<ej2  fddZDede>eDZEeDj@jAZFde ej<ej2  fddZGej:ej;edd#ddZHed e>eHZIeHj@jAZJd!d" ZKd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ListTV_XlaClusterOutput_Txla_cluster_outputinputreturnc                 C   s  t j pt  }|j}|jrzzt|d|| }|W S  tjy1 } zt	|| W Y d}~nd}~w tj
y:   Y nw zt| |fd}|turJ|W S t| ||dW S  tjy[   Y n, ttfyy   ttdt| |d}|tjjurx| Y S  w t| |fd}|tur|S ztjd| |d\}}}}W n ttfy   ttdt| |d}|tjjur| Y S  w |dd }t rd|df}	|j}
td|
|	| |\}|S )zOperator that connects the output of an XLA computation to other consumer graph nodes.

  Args:
    input: A `Tensor`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  XlaClusterOutputN)namectx )r   r   T)_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackException"_dispatcher_for_xla_cluster_outputNotImplemented!xla_cluster_output_eager_fallback_SymbolicException	TypeError
ValueError	_dispatchr   r   dictOpDispatcherNOT_SUPPORTED_op_def_library_apply_op_helper_executemust_record_gradient_get_attr_typeinputsrecord_gradient)r   r   _ctxtld_resulte__op_outputs_attrs_inputs_flatr   r   R/var/www/myenv/lib/python3.10/site-packages/tensorflow/compiler/jit/ops/xla_ops.pyr      sv   zraw_ops.XlaClusterOutputc                 C   s\   t | g|g \}\} | g}d|f}t jdd||||d}t  r)t d||| |\}|S )Nr   s   XlaClusterOutput   r1   attrsr   r   r   )r.   args_to_matching_eagerr   r/   r2   )r   r   r   _attr_Tr;   r:   r5   r   r   r<   r$   _   s   
r$   
xla_launch	resourcesc                 C   s`  t j pt  }|j}|jrzt|d|| ||d|d|
}|W S  tjy7 }	 zt	|	| W Y d}	~	nd}	~	w tj
y@   Y nw zt| |||||fd}|turT|W S t| ||||||dW S  tjyi   Y n4 ttfy   ttdt| |||||d}|tjjur| Y S  w t| |||||fd}|tur|S t|ttfstd| t|}
t|ttfstd	| d
d |D }ztjd| |||||d\}}}}W n# ttfy   ttdt| |||||d}|tjjur| Y S  w |dd }|s|S t r.d|dd|dd| dd|dd|df
}|j!}t"d||| |S )a  XLA Launch Op. For use by the XLA JIT only.

  Args:
    constants: A list of `Tensor` objects.
    args: A list of `Tensor` objects.
    resources: A list of `Tensor` objects with type `resource`.
    Tresults: A list of `tf.DTypes`.
    function: A function decorated with @Defun.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `Tresults`.
  	XlaLaunchTresultsfunctionN)rE   rF   r   r   r   )	constantsargsrC   rE   rF   r   BExpected list for 'resources' argument to 'xla_launch' Op, not %r.AExpected list for 'Tresults' argument to 'xla_launch' Op, not %r.c                 S      g | ]}t |d qS rE   r.   	make_type.0_tr   r   r<   
<listcomp>       zxla_launch.<locals>.<listcomp>
TconstantsTargs
Nresources)#r   r   r   r   r   r   r   r   r   r    r!   _dispatcher_for_xla_launchr#   xla_launch_eager_fallbackr%   r&   r'   r(   r   rB   r)   r*   r+   
isinstancelisttuplelenr,   r-   r.   r/   get_attr_get_attr_intr1   r2   )rG   rH   rC   rE   rF   r   r3   r4   r5   r6   _attr_Nresourcesr7   r8   r9   r:   r;   r   r   r<   rB   l   s   



	


zraw_ops.XlaLaunchc              
   C   s   t |ttfstd| t|}t |ttfstd| dd |D }t| |\}} t||\}	}t|t	j
}t| t| t| }
d|d|	d|d|d	|f
}tjd
t||
|||d}t rmtd|
|| |S )NrI   rJ   c                 S   rK   rL   rM   rO   r   r   r<   rR      rS   z-xla_launch_eager_fallback.<locals>.<listcomp>rT   rU   rV   rE   rF   s	   XlaLaunchr>   rD   )rY   rZ   r[   r&   r\   r.   convert_to_mixed_eager_tensorsr   convert_n_to_tensor_dtypesresourcer   r/   r2   )rG   rH   rC   rE   rF   r   r   r_   _attr_Tconstants_attr_Targsr;   r:   r5   r   r   r<   rX      s:   rX   xla_launch_v2c                 C   s  t j pt  }|j}|jrzt|d|| d|d|d|d|}|W S  tjy9 }	 zt	|	| W Y d}	~	nd}	~	w tj
yB   Y nw zt| |||||fd}|turV|W S t| ||||||dW S  tjyk   Y n4 ttfy   ttdt| |||||d	}|tjjur| Y S  w t| |||||fd}|tur|S t|ttfstd
| dd |D }t|ttfstd| dd |D }t|ttfstd| dd |D }ztjd| |||||d	\}
}
}}W n% ttfy   ttdt| |||||d	}|tjjur| Y S  w |dd }t rDd|dd|dd|dd|dd|df
}|j}t d||| |S )ab  XLA Launch Op. For use by the XLA JIT only.

  Args:
    args: A list of `Tensor` objects.
    Tresults: A list of `tf.DTypes`.
    constants: A list of `ints`.
    resources: A list of `ints`.
    function: A function decorated with @Defun.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `Tresults`.
  XlaLaunchV2rE   rG   rC   rF   N)rE   rG   rC   rF   r   r   r   )rH   rE   rG   rC   rF   r   DExpected list for 'Tresults' argument to 'xla_launch_v2' Op, not %r.c                 S   rK   rL   rM   rO   r   r   r<   rR     rS   z!xla_launch_v2.<locals>.<listcomp>EExpected list for 'constants' argument to 'xla_launch_v2' Op, not %r.c                 S   rK   rG   r.   make_intrP   _ir   r   r<   rR   "  rS   EExpected list for 'resources' argument to 'xla_launch_v2' Op, not %r.c                 S   rK   rC   rk   rm   r   r   r<   rR   '  rS   rU   )!r   r   r   r   r   r   r   r   r   r    r!   _dispatcher_for_xla_launch_v2r#   xla_launch_v2_eager_fallbackr%   r&   r'   r(   r   rf   r)   r*   r+   rY   rZ   r[   r,   r-   r.   r/   r]   r1   r2   )rH   rE   rG   rC   rF   r   r3   r4   r5   r6   r7   r8   r9   r:   r;   r   r   r<   rf      s   



	


zraw_ops.XlaLaunchV2c              
   C   s   t |ttfstd| dd |D }t |ttfs!td| dd |D }t |ttfs5td| dd |D }t| |\}} t| }d|d	|d
|d|d|f
}	tjdt|||	||d}
t rmt	d||	|
 |
S )Nrh   c                 S   rK   rL   rM   rO   r   r   r<   rR   I  rS   z0xla_launch_v2_eager_fallback.<locals>.<listcomp>ri   c                 S   rK   rj   rk   rm   r   r   r<   rR   N  rS   ro   c                 S   rK   rp   rk   rm   r   r   r<   rR   S  rS   rU   rE   rG   rC   rF   s   XlaLaunchV2r>   rg   )
rY   rZ   r[   r&   r.   r`   r   r\   r/   r2   )rH   rE   rG   rC   rF   r   r   re   r;   r:   r5   r   r   r<   rr   D  sF   

rr   )N)L__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r   r   r   r   r.   tensorflow.python.frameworkr   rb   tensorflow.security.fuzzing.pyr   _atypesr   _op_def_registryr	   r   r
   r,   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   r(    tensorflow.python.util.tf_exportr   typingr   r   BFloat16Bool
Complex128	Complex64Float16Float32Float64HalfInt16Int32Int64Int8QInt16QInt32QInt8QUInt16QUInt8ResourceStringUInt16UInt32UInt64UInt8Variantr   add_fallback_dispatch_listadd_type_based_api_dispatcherTensorFuzzingAnnotationr   	to_raw_opr   _tf_type_based_dispatcherDispatchr"   r$   rB   rD   rW   rX   rf   rg   rq   rr   r   r   r   r<   <module>   sJ    h&>"WZ