o
    ®Ÿ?e% ã                   @   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&ƒZ'dydej(e' dej(ej% dej(ej% dej(ej% de ej(ej)  de*de+dej(e' fdd„Z,edƒe -e,¡ƒZ.dej(e' dej(ej% dej(ej% dej(ej% de ej(ej)  de*de+dej(e' fdd„Z/edej!ej"ej#ej$ej%ej&ƒZ0dzdej(e0 d ej(ej) d!ej(ej% de+dej(e0 f
d"d#„Z1ed$ƒe -e1¡ƒZ2dej(e0 d ej(ej) d!ej(ej% de+dej(e0 f
d%d&„Z3e 4d'ddg¡Z5d{d!ej(ej% d(ej(ej% d)ej(ej% fd*d+„Z6ed,ƒe -e6¡ƒZ7d!ej(ej% d(ej(ej% d)ej(ej% fd-d.„Z8ed/ej9ej"ej#ej$ej%ej&ƒZ:dyd0e:de;de;de;de*de+dej(e: fd1d2„Z<ed3ƒe -e<¡ƒZ=d0e:de;de;de;de*de+dej(e: fd4d5„Z>ed6ej9ej"ej#ej$ej%ej&ƒZ?ed7ej%ej&ƒZ@dydej(ej% dej(ej% dej(ej% d8ej(e@ d0e?de*de+dej(e? fd9d:„ZAed;ƒe -eA¡ƒZBdej(ej% dej(ej% dej(ej% d8ej(e@ d0e?de*de+dej(e? fd<d=„ZCed>ej9ej"ej#ej$ej%ej&ƒZDdydej(eD de;de;de;de*de+dej(eD fd?d@„ZEedAƒe -eE¡ƒZFdej(eD de;de;de;de*de+dej(eD fdBdC„ZGedDej9ej"ej#ej$ej%ej&ƒZHdydej(eH dej(ej% dej(ej% dej(ej% de*de+dej(eH fdEdF„ZIedGƒe -eI¡ƒZJdej(eH dej(ej% dej(ej% dej(ej% de*de+dej(eH fdHdI„ZKedJej"ej#ej$ej%ej&ƒZLdydej(eL de;de;de;de*de+dej(eL fdKdL„ZMedMƒe -eM¡ƒZNdej(eL de;de;de;de*de+dej(eL fdNdO„ZOedPej"ej#ej$ej%ej&ƒZPdydej(eP dej(ej% dej(ej% dej(ej% de ej(ej)  de*de+dej(eP fdQdR„ZQedSƒe -eQ¡ƒZRdej(eP dej(ej% dej(ej% dej(ej% de ej(ej)  de*de+dej(eP fdTdU„ZSdydej(ej% dVej(ej% dej(ej% de*de+dej(ej) fdWdX„ZTedYƒe -eT¡ƒZUdej(ej% dVej(ej% dej(ej% de*de+dej(ej) fdZd[„ZVed\ej!ej"ej#ej$ej%ej&ƒZWg dddfdej(eW de;de;de;d]e*d^e*de*de+dej(eW fd_d`„ZXedaƒe -eX¡ƒZYdej(eW de;de;de;d]e*d^e*de*de+dej(eW fdbdc„ZZeddej!ej"ej#ej$ej%ej&ƒZ[d|dej(e[ dej(ej% dej(ej% dej(ej% de ej(ej)  d]e*d^e*de*de+dfe;dej(e[ fdgdh„Z\ediƒe -e\¡ƒZ]dej(e[ dej(ej% dej(ej% dej(ej% de ej(ej)  d]e*d^e*de*de+dfe;dej(e[ fdjdk„Z^edlej!ej"ej#ej$ej%ej&ƒZ_d|dej(e_ dej(ej% dej(ej% dej(ej% de ej(ej)  d]e*d^e*de*de+dfe;dej(e_ fdmdn„Z`edoƒe -e`¡ƒZadej(e_ dej(ej% dej(ej% dej(ej% de ej(ej)  d]e*d^e*de*de+dfe;dej(e_ fdpdq„Zbedrej!ej"ej#ej$ej%ej&ƒZcdzdej(ec d ej(ej) d!ej(ej% dse*de+dej(ec fdtdu„Zdedvƒe -ed¡ƒZedej(ec d ej(ej) d!ej(ej% dse*de+dej(ec fdwdx„Zfd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_CollectiveAllToAllV2_TÚautoÚinputÚ
group_sizeÚ	group_keyÚinstance_keyÚordering_tokenÚcommunication_hintÚtimeout_secondsÚreturnc                 C   óŽ  t j pt  ¡ }|j}	|	jr\zt |d|| ||||d|d|¡}
|
W S  tjy9 } zt 	||¡ W Y d}~nd}~w tj
yB   Y nw zt| ||||||||d	W S  tjy[   Y nw t|ttfƒsitd| ƒ‚t|ƒ}|du rsd}t |d¡}|du rd}t |d¡}tjd| |||||||d		\}}}}|dd… }
t ¡ rÂd
| d
¡d| d¡d| d¡d| d¡f}|j}t d|||
¡ |
\}
|
S )au  Mutually exchanges multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
    instance_key: A `Tensor` of type `int32`.
    ordering_token: A list of `Tensor` objects with type `resource`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveAllToAllV2r   r   N©r   r   ÚnameÚctxúUExpected list for 'ordering_token' argument to 'collective_all_to_all_v2' Op, not %r.r   r   ©r   r   r   r   r   r   r   r   ÚTÚNordering_token)Ú_contextr   Ú_thread_local_dataÚis_eagerr   ÚTFE_Py_FastPathExecuteÚ_coreÚ_NotOkStatusExceptionÚ_opsÚraise_from_not_ok_statusÚ_FallbackExceptionÚ'collective_all_to_all_v2_eager_fallbackÚ_SymbolicExceptionÚ
isinstanceÚlistÚtupleÚ	TypeErrorÚlenÚ_executeÚmake_strÚ
make_floatÚ_op_def_libraryÚ_apply_op_helperÚmust_record_gradientÚ_get_attr_typeÚget_attrÚ_get_attr_intÚinputsÚrecord_gradient©r   r   r   r   r   r   r   r   Ú_ctxÚtldÚ_resultÚeÚ_attr_Nordering_tokenÚ_Ú_opÚ_outputsÚ_attrsÚ_inputs_flat© rI   úi/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/ops/gen_collective_ops.pyÚcollective_all_to_all_v2   sv   ý€ÿ
ýÿÿÿú

ýÿrK   zraw_ops.CollectiveAllToAllV2c	              
   C   s  t |ttfƒstd| ƒ‚t|ƒ}	|d u rd}t |d¡}|d u r#d}t |d¡}t | g|t	j
t	jt	jt	jt	jt	jg¡\}
\} t |t	j¡}t |t	j¡}t |t	j¡}t |t	j¡}| |||gt|ƒ }d|
d|d|d|	f}tjdd	||||d
}t ¡ r‡t d|||¡ |\}|S )Nr   r   r   r   r   r!   r"   s   CollectiveAllToAllV2é   ©r<   Úattrsr   r   r   )r.   r/   r0   r1   r2   r3   r4   r5   Úargs_to_matching_eagerÚ_dtypesÚbfloat16Úfloat32ÚhalfÚfloat64Úint32Úint64r)   Úconvert_to_tensorÚconvert_n_to_tensorÚresourcer   r8   r=   ©r   r   r   r   r   r   r   r   r   rC   Ú_attr_TrH   rG   rA   rI   rI   rJ   r,   `   s@   ÿÿ.þ
ÿÿr,   ÚTV_CollectiveAllToAllV3_TÚcommunicatorÚgroup_assignmentc              
   C   s,  t j pt  ¡ }|j}|jrUzt |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yT   Y nw |du r[d}t |d¡}tjd| ||||d\}	}	}
}|dd… }t ¡ r‘d|
 d¡d|
 d¡f}|
j}t d|||¡ |\}|S )aÊ  Mutually exchanges multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `half`, `float64`, `int32`, `int64`.
    communicator: A `Tensor` of type `resource`.
    group_assignment: A `Tensor` of type `int32`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveAllToAllV3r   N)r   r   r   r   )r   r]   r^   r   r   r!   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú'collective_all_to_all_v3_eager_fallbackr-   r3   r5   r6   r7   r8   r9   r:   r<   r=   )r   r]   r^   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_all_to_all_v3€   sT   
þ€ÿþÿýÿÿra   zraw_ops.CollectiveAllToAllV3c           
   
   C   s°   |d u rd}t  |d¡}t  | g|tjtjtjtjtjtj	g¡\}\} t
 |tj¡}t
 |tj¡}| ||g}d|d|f}t jdd||||d}	t  ¡ rSt  d|||	¡ |	\}	|	S )Nr   r   r!   s   CollectiveAllToAllV3rL   rM   r_   )r3   r5   rO   rP   rQ   rR   rS   rT   rU   rV   r)   rW   rY   r   r8   r=   )
r   r]   r^   r   r   r   r[   rH   rG   rA   rI   rI   rJ   r`   ´   s"   .

ÿÿr`   ÚCollectiveAssignGroupV2Údevice_indexÚbase_keyc              
   C   s  t j pt  ¡ }|j}|jrWzt |d|| ||¡}t |¡}|W S  tj	y8 } zt
 ||¡ W Y d}~nd}~w tjyA   Y nw z
t| ||||dW S  tjyV   Y nw tjd| |||d\}}}	}
|
dd… }t ¡ r|d}|	j}t d|||¡ t |¡}|S )aŽ  Assign group keys based on group assignment.

  Args:
    group_assignment: A `Tensor` of type `int32`.
    device_index: A `Tensor` of type `int32`.
    base_key: A `Tensor` of type `int32`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (group_size, group_key).

    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
  rb   N)r   r   )r^   rc   rd   r   rI   )r#   r   r$   r%   r   r&   Ú_CollectiveAssignGroupV2OutputÚ_maker'   r(   r)   r*   r+   Ú)collective_assign_group_v2_eager_fallbackr-   r6   r7   r3   r8   r<   r=   )r^   rc   rd   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_assign_group_v2Ê   sJ   
þ
€ÿ
ÿÿýÿ
rh   zraw_ops.CollectiveAssignGroupV2c                 C   st   t  | tj¡} t  |tj¡}t  |tj¡}| ||g}d }tjdd||||d}t ¡ r3t d|||¡ t 	|¡}|S )Ns   CollectiveAssignGroupV2é   rM   rb   )
r)   rW   rP   rU   r3   r   r8   r=   re   rf   )r^   rc   rd   r   r   rH   rG   rA   rI   rI   rJ   rg   ü   s   
þÿ
rg   ÚTV_CollectiveBcastRecv_Tr!   c                 C   sÐ  t j pt  ¡ }|j}	|	jrazt |d|d| d|d|d|d|d|d|¡}
|
W S  tjy> } zt 	||¡ W Y d	}~nd	}~w tj
yG   Y nw zt| ||||||||d
	W S  tjy`   Y nw t | d¡} t |d¡}t |d¡}t |d¡}t |d¡}|d	u r…d}t |d¡}|d	u r‘d}t |d¡}tjd| |||||||d	\}}}}|d	d	… }
t ¡ rãd| d¡d| d¡d| d¡d| d¡d| d¡d| d¡d| d¡f}|j}t d|||
¡ |
\}
|
S )aò  Receives a tensor value broadcast from another device.

  Args:
    T: A `tf.DType` from: `tf.bool, tf.float32, tf.half, tf.float64, tf.int32, tf.int64`.
    group_size: An `int`.
    group_key: An `int`.
    instance_key: An `int`.
    shape: A `tf.TensorShape` or list of `ints`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `T`.
  ÚCollectiveBcastRecvr!   r   r   r   Úshaper   r   N)	r!   r   r   r   rl   r   r   r   r   r   r   )r!   r   r   r   rl   r   r   r   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú$collective_bcast_recv_eager_fallbackr-   r3   Ú	make_typeÚmake_intÚ
make_shaper4   r5   r6   r7   r8   r9   r;   r:   r<   r=   )r!   r   r   r   rl   r   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_bcast_recv  sz   ü€ÿüÿû




úÿrq   zraw_ops.CollectiveBcastRecvc	                 C   sÈ   t  | d¡} t  |d¡}t  |d¡}t  |d¡}t  |d¡}|d u r$d}t  |d¡}|d u r0d}t  |d	¡}g }	d| d|d|d|d|d|d	|f}
t jd
d|	|
||d}t  ¡ r_t  d|	|
|¡ |\}|S )Nr!   r   r   r   rl   r   r   r   r   s   CollectiveBcastRecvrL   rM   rk   )	r3   rn   ro   rp   r4   r5   r   r8   r=   )r!   r   r   r   rl   r   r   r   r   rH   rG   rA   rI   rI   rJ   rm   X  s2   
þ
ÿÿrm   ÚTV_CollectiveBcastRecvV2_TÚTV_CollectiveBcastRecvV2_Tshaperl   c                 C   sz  t j pt  ¡ }|j}	|	jr]zt |d|| |||d|d|d|¡}
|
W S  tjy: } zt 	||¡ W Y d}~nd}~w tj
yC   Y nw zt| ||||||||d	W S  tjy\   Y nw t |d¡}|du rid}t |d¡}|du rud}t |d¡}tjd| |||||||d		\}}}}|dd… }
t ¡ r¸d| d¡d
| d
¡d| d¡d| d¡f}|j}t d|||
¡ |
\}
|
S )aD  Receives a tensor value broadcast from another device.

  Args:
    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
    instance_key: A `Tensor` of type `int32`.
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
    T: A `tf.DType` from: `tf.bool, tf.float32, tf.half, tf.float64, tf.int32, tf.int64`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `T`.
  ÚCollectiveBcastRecvV2r!   r   r   N)r!   r   r   r   r   r   r   )r   r   r   rl   r!   r   r   r   ÚTshape)r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú'collective_bcast_recv_v2_eager_fallbackr-   r3   rn   r4   r5   r6   r7   r8   r9   r:   r<   r=   )r   r   r   rl   r!   r   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_bcast_recv_v2t  sf   
ý€ÿ
ýÿü

ýÿrw   zraw_ops.CollectiveBcastRecvV2c	                 C   sà   t  |d¡}|d u rd}t  |d¡}|d u rd}t  |d¡}t  |g|tjtjgtj¡\}	\}t 	| tj¡} t 	|tj¡}t 	|tj¡}| |||g}
d|d|	d|d|f}t j
dd|
|||d	}t  ¡ rkt  d
|
||¡ |\}|S )Nr!   r   r   r   r   ru   s   CollectiveBcastRecvV2rL   rM   rt   )r3   rn   r4   r5   rO   rP   rU   rV   r)   rW   r   r8   r=   )r   r   r   rl   r!   r   r   r   r   Z_attr_TshaperH   rG   rA   rI   rI   rJ   rv   ´  s0   "
ÿ
ÿÿrv   ÚTV_CollectiveBcastSend_Tc                 C   óÂ  t j pt  ¡ }|j}	|	jr`zt |d|| d|d|d|d|d|d|¡}
|
W S  tjy= } zt 	||¡ W Y d}~nd}~w tj
yF   Y nw zt| ||||||||d		W S  tjy_   Y nw t |d¡}t |d¡}t |d¡}t |d¡}|du r~d
}t |d¡}|du rŠd}t |d¡}tjd| |||||||d	\}}}}|dd… }
t ¡ rÜd| d¡d| d¡d| d¡d| d¡d| d¡d| d¡d| d¡f}|j}t d|||
¡ |
\}
|
S )a  Broadcasts a tensor value to one or more other devices.

  Args:
    input: A `Tensor`. Must be one of the following types: `bool`, `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: An `int`.
    group_key: An `int`.
    instance_key: An `int`.
    shape: A `tf.TensorShape` or list of `ints`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveBcastSendr   r   r   rl   r   r   N©r   r   r   rl   r   r   r   r   r   r   ©r   r   r   r   rl   r   r   r   r!   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú$collective_bcast_send_eager_fallbackr-   r3   ro   rp   r4   r5   r6   r7   r8   r9   r;   r:   r<   r=   ©r   r   r   r   rl   r   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_bcast_sendÎ  óx   ü€ÿüÿû




úÿr   zraw_ops.CollectiveBcastSendc	                 C   sì   t  |d¡}t  |d¡}t  |d¡}t  |d¡}|d u rd}t  |d¡}|d u r*d}t  |d¡}t  | g|tjtjtj	tj
tjtjg¡\}	\} | g}
d	|	d|d|d|d|d|d|f}t jd
d|
|||d}t  ¡ rqt  d|
||¡ |\}|S )Nr   r   r   rl   r   r   r   r   r!   s   CollectiveBcastSendrL   rM   rz   )r3   ro   rp   r4   r5   rO   rP   ÚboolrR   rS   rT   rU   rV   r   r8   r=   ©r   r   r   r   rl   r   r   r   r   r[   rH   rG   rA   rI   rI   rJ   r}     s2   .
þ
ÿÿr}   ÚTV_CollectiveBcastSendV2_Tc                 C   s\  t j pt  ¡ }|j}|jrZzt |d|| |||d|d|¡}	|	W S  tjy8 }
 zt 	|
|¡ W Y d}
~
nd}
~
w tj
yA   Y nw zt| |||||||dW S  tjyY   Y nw |du r`d}t |d¡}|du rld}t |d¡}tjd| ||||||d\}}}}|dd… }	t ¡ r©d	| d	¡d| d¡d| d¡f}|j}t d|||	¡ |	\}	|	S )
a#  Broadcasts a tensor value to one or more other devices.

  Args:
    input: A `Tensor`. Must be one of the following types: `bool`, `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
    instance_key: A `Tensor` of type `int32`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveBcastSendV2r   r   Nr   r   r   )r   r   r   r   r   r   r   r!   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú'collective_bcast_send_v2_eager_fallbackr-   r3   r4   r5   r6   r7   r8   r9   r:   r<   r=   )r   r   r   r   r   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_bcast_send_v22  sd   ý€ÿýÿû
þÿr†   zraw_ops.CollectiveBcastSendV2c              
   C   sÜ   |d u rd}t  |d¡}|d u rd}t  |d¡}t  | g|tjtjtjtjtj	tj
g¡\}\} t |tj	¡}t |tj	¡}t |tj	¡}| |||g}	d|d|d|f}
t jdd|	|
||d}t  ¡ rit  d	|	|
|¡ |\}|S )
Nr   r   r   r   r!   s   CollectiveBcastSendV2rL   rM   r„   )r3   r4   r5   rO   rP   r   rR   rS   rT   rU   rV   r)   rW   r   r8   r=   )r   r   r   r   r   r   r   r   r[   rH   rG   rA   rI   rI   rJ   r…   p  s.   .ÿ
ÿÿr…   ÚTV_CollectiveGather_Tc                 C   ry   )a!  Mutually accumulates multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: An `int`.
    group_key: An `int`.
    instance_key: An `int`.
    shape: A `tf.TensorShape` or list of `ints`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveGatherr   r   r   rl   r   r   Nr{   r   r   r|   r!   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú collective_gather_eager_fallbackr-   r3   ro   rp   r4   r5   r6   r7   r8   r9   r;   r:   r<   r=   r~   rI   rI   rJ   Úcollective_gather‰  r€   rŠ   zraw_ops.CollectiveGatherc	                 C   sè   t  |d¡}t  |d¡}t  |d¡}t  |d¡}|d u rd}t  |d¡}|d u r*d}t  |d¡}t  | g|tjtjtj	tj
tjg¡\}	\} | g}
d	|	d|d|d|d|d|d|f}t jd
d|
|||d}t  ¡ rot  d|
||¡ |\}|S )Nr   r   r   rl   r   r   r   r   r!   s   CollectiveGatherrL   rM   rˆ   )r3   ro   rp   r4   r5   rO   rP   rR   rS   rT   rU   rV   r   r8   r=   r‚   rI   rI   rJ   r‰   Ò  s2   *
þ
ÿÿr‰   ÚTV_CollectiveGatherV2_Tc                 C   r   )ak  Mutually accumulates multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
    instance_key: A `Tensor` of type `int32`.
    ordering_token: A list of `Tensor` objects with type `resource`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveGatherV2r   r   Nr   úQExpected list for 'ordering_token' argument to 'collective_gather_v2' Op, not %r.r   r   r    r!   r"   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú#collective_gather_v2_eager_fallbackr-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   rI   rI   rJ   Úcollective_gather_v2í  st   ý€ÿ
ýÿÿÿû

ýÿr   zraw_ops.CollectiveGatherV2c	              	   C   s  t |ttfƒstd| ƒ‚t|ƒ}	|d u rd}t |d¡}|d u r#d}t |d¡}t | g|t	j
t	jt	jt	jt	jg¡\}
\} t |t	j¡}t |t	j¡}t |t	j¡}t |t	j¡}| |||gt|ƒ }d|
d|d|d|	f}tjdd	||||d
}t ¡ r…t d|||¡ |\}|S )Nr   r   r   r   r   r!   r"   s   CollectiveGatherV2rL   rM   rŒ   )r.   r/   r0   r1   r2   r3   r4   r5   rO   rP   rR   rS   rT   rU   rV   r)   rW   rX   rY   r   r8   r=   rZ   rI   rI   rJ   rŽ   2  s@   ÿÿ*þ
ÿÿrŽ   Úrankc                 C   sL  t j pt  ¡ }|j}|jrXz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| ||||||dW S  tjyW   Y nw |du r^d}t |d¡}|du rjd}t |d¡}tjd| |||||d\}
}
}}|dd… }t ¡ r¡d| d¡d| d¡f}|j}t d|||¡ |\}|S )	a”  Initializes a group for collective operations.

  Args:
    group_key: A `Tensor` of type `int32`.
    rank: A `Tensor` of type `int32`.
    group_size: A `Tensor` of type `int32`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `resource`.
  Ú CollectiveInitializeCommunicatorr   r   Nr   r   r   )r   r   r   r   r   r   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú1collective_initialize_communicator_eager_fallbackr-   r3   r4   r5   r6   r7   r8   r:   r<   r=   )r   r   r   r   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Ú"collective_initialize_communicatorP  s`   
ý€ÿþÿû

ÿÿr“   z(raw_ops.CollectiveInitializeCommunicatorc           
      C   s¨   |d u rd}t  |d¡}|d u rd}t  |d¡}t | tj¡} t |tj¡}t |tj¡}| ||g}d|d|f}t jdd||||d}	t  ¡ rOt  	d|||	¡ |	\}	|	S )	Nr   r   r   r   s    CollectiveInitializeCommunicatorrL   rM   r‘   )
r3   r4   r5   r)   rW   rP   rU   r   r8   r=   )
r   r   r   r   r   r   r   rH   rG   rA   rI   rI   rJ   r’   ‹  s.   
ÿþÿr’   ÚTV_CollectiveReduce_TÚmerge_opÚfinal_opc                 C   sb  t j pt  ¡ }|j}|jrizt |d|
| d|d|d|d|d|d|d|d	|d
|	¡}|W S  tjyC } zt 	||
¡ W Y d}~nd}~w tj
yL   Y nw zt| |||||||||	|
|dW S  tjyh   Y nw t |d¡}t |d¡}t |d¡}t |d¡}t |d¡}t|ttfƒs”td| ƒ‚dd„ |D ƒ}|du r¡g }t|ttfƒs®td| ƒ‚dd„ |D ƒ}|du r»d}t |d	¡}|	du rÇd}	t |	d
¡}	tjd| |||||||||	|
d\}}}}|dd… }t ¡ r,d| d¡d| d¡d| d¡d| d¡d| d¡d| d¡d| d¡d| d¡d	| d	¡d
| d
¡f}|j}t d|||¡ |\}|S )aÅ  Mutually reduces multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: An `int`.
    group_key: An `int`.
    instance_key: An `int`.
    merge_op: A `string` from: `"Min", "Max", "Mul", "Add"`.
    final_op: A `string` from: `"Id", "Div"`.
    subdiv_offsets: A list of `ints`.
    wait_for: An optional list of `ints`. Defaults to `[]`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveReducer   r   r   r•   r–   Úsubdiv_offsetsÚwait_forr   r   N)r   r   r   r•   r–   r˜   r™   r   r   r   r   úNExpected list for 'subdiv_offsets' argument to 'collective_reduce' Op, not %r.c                 S   ó   g | ]}t  |d ¡‘qS ©r˜   ©r3   ro   ©Ú.0Z_irI   rI   rJ   Ú
<listcomp>Ù  ó    z%collective_reduce.<locals>.<listcomp>úHExpected list for 'wait_for' argument to 'collective_reduce' Op, not %r.c                 S   r›   ©r™   r   rž   rI   rI   rJ   r    à  r¡   r   r   )r   r   r   r   r•   r–   r˜   r™   r   r   r   r!   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú collective_reduce_eager_fallbackr-   r3   ro   r4   r.   r/   r0   r1   r5   r6   r7   r8   r9   r;   r:   r<   r=   )r   r   r   r   r•   r–   r˜   r™   r   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_reduce¤  s¤   

û€ÿûÿÿÿÿÿú





ø	ÿr¥   zraw_ops.CollectiveReducec                 C   s`  t  |d¡}t  |d¡}t  |d¡}t  |d¡}t  |d¡}t|ttfƒs+td| ƒ‚dd„ |D ƒ}|d u r8g }t|ttfƒsEtd	| ƒ‚d
d„ |D ƒ}|d u rRd}t  |d¡}|	d u r^d}	t  |	d¡}	t  | g|t	j
t	jt	jt	jt	jt	jg¡\}\} | g}d|d|d|d|d|d|d|d|d|d|	f}t jdd||||
d}t  ¡ r«t  d|||¡ |\}|S )Nr   r   r   r•   r–   rš   c                 S   r›   rœ   r   rž   rI   rI   rJ   r      r¡   z4collective_reduce_eager_fallback.<locals>.<listcomp>r¢   c                 S   r›   r£   r   rž   rI   rI   rJ   r      r¡   r   r   r   r   r!   r˜   r™   s   CollectiveReducerL   rM   r—   )r3   ro   r4   r.   r/   r0   r1   r5   rO   rP   rQ   rR   rS   rT   rU   rV   r   r8   r=   )r   r   r   r   r•   r–   r˜   r™   r   r   r   r   r[   rH   rG   rA   rI   rI   rJ   r¤     sX   ÿÿÿÿ.ü
ÿÿr¤   ÚTV_CollectiveReduceScatterV2_TéÿÿÿÿÚmax_subdivs_per_devicec                 C   óô  t j pt  ¡ }|j}|jrezt |d|
| ||||d|d|d|d|d|	¡}|W S  tjy? } zt 	||
¡ W Y d}~nd}~w tj
yH   Y nw zt| |||||||||	|
|dW S  tjyd   Y nw t|ttfƒsrtd	| ƒ‚t|ƒ}t |d¡}t |d¡}|du rˆd
}t |d¡}|du r”d}t |d¡}|	du r d}	t |	d¡}	tjd| |||||||||	|
d\}}}}|dd… }t ¡ rõd| d¡d| d¡d| d¡d| d¡d| d¡d| d¡d| d¡f}|j}t d|||¡ |\}|S )a7  Mutually reduces multiple tensors of identical type and shape and scatters the result.

  Args:
    input: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
    instance_key: A `Tensor` of type `int32`.
    ordering_token: A list of `Tensor` objects with type `resource`.
    merge_op: A `string` from: `"Min", "Max", "Mul", "Add"`.
    final_op: A `string` from: `"Id", "Div"`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    max_subdivs_per_device: An optional `int`. Defaults to `-1`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveReduceScatterV2r•   r–   r   r   r¨   N©r•   r–   r   r   r¨   r   r   úYExpected list for 'ordering_token' argument to 'collective_reduce_scatter_v2' Op, not %r.r   r   r§   ©r   r   r   r   r   r•   r–   r   r   r¨   r   r!   r"   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú+collective_reduce_scatter_v2_eager_fallbackr-   r.   r/   r0   r1   r2   r3   r4   r5   ro   r6   r7   r8   r9   r:   r;   r<   r=   ©r   r   r   r   r   r•   r–   r   r   r¨   r   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_reduce_scatter_v2,  s’   
ü€ÿ
ûÿÿÿ÷



úÿr°   z!raw_ops.CollectiveReduceScatterV2c                 C   óT  t |ttfƒstd| ƒ‚t|ƒ}t |d¡}t |d¡}|d u r#d}t |d¡}|d u r/d}t |d¡}|	d u r;d}	t |	d	¡}	t 	| g|t
jt
jt
jt
jt
jt
jg¡\}\} t |t
j¡}t |t
j¡}t |t
j¡}t |t
j¡}| |||gt|ƒ }d
|d|d|d|d|d|d	|	f}tjdd||||
d}t ¡ r¥t d|||¡ |\}|S )Nr¬   r•   r–   r   r   r   r   r§   r¨   r!   r"   s   CollectiveReduceScatterV2rL   rM   rª   ©r.   r/   r0   r1   r2   r3   r4   r5   ro   rO   rP   rQ   rR   rS   rT   rU   rV   r)   rW   rX   rY   r   r8   r=   ©r   r   r   r   r   r•   r–   r   r   r¨   r   r   rC   r[   rH   rG   rA   rI   rI   rJ   r®   ƒ  sN   ÿÿ.ýþÿr®   ÚTV_CollectiveReduceV2_Tc                 C   r©   )a  Mutually reduces multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `half`, `float64`, `int32`, `int64`.
    group_size: A `Tensor` of type `int32`.
    group_key: A `Tensor` of type `int32`.
    instance_key: A `Tensor` of type `int32`.
    ordering_token: A list of `Tensor` objects with type `resource`.
    merge_op: A `string` from: `"Min", "Max", "Mul", "Add"`.
    final_op: A `string` from: `"Id", "Div"`.
    communication_hint: An optional `string`. Defaults to `"auto"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    max_subdivs_per_device: An optional `int`. Defaults to `-1`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveReduceV2r•   r–   r   r   r¨   Nr«   úQExpected list for 'ordering_token' argument to 'collective_reduce_v2' Op, not %r.r   r   r§   r­   r!   r"   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú#collective_reduce_v2_eager_fallbackr-   r.   r/   r0   r1   r2   r3   r4   r5   ro   r6   r7   r8   r9   r:   r;   r<   r=   r¯   rI   rI   rJ   Úcollective_reduce_v2ª  s   
ü€ÿ
ûÿÿÿø	


úÿr¸   zraw_ops.CollectiveReduceV2c                 C   r±   )Nr¶   r•   r–   r   r   r   r   r§   r¨   r!   r"   s   CollectiveReduceV2rL   rM   rµ   r²   r³   rI   rI   rJ   r·      sL   ÿÿ.ý
ÿÿr·   ÚTV_CollectiveReduceV3_TÚ	reductionc                 C   sJ  t j pt  ¡ }|j}|jrXz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| ||||||dW S  tjyW   Y nw t |d¡}|du rdd}t |d¡}tjd| |||||d\}
}
}}|dd… }t ¡ r d| d¡d| d¡d| d¡f}|j}t d|||¡ |\}|S )	a  Mutually reduces multiple tensors of identical type and shape.

  Args:
    input: A `Tensor`. Must be one of the following types: `bfloat16`, `float32`, `half`, `float64`, `int32`, `int64`.
    communicator: A `Tensor` of type `resource`.
    group_assignment: A `Tensor` of type `int32`.
    reduction: A `string` from: `"Min", "Max", "Mul", "Add"`.
    timeout_seconds: An optional `float`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  ÚCollectiveReduceV3rº   r   N)rº   r   r   r   r   )r   r]   r^   rº   r   r   r!   )r#   r   r$   r%   r   r&   r'   r(   r)   r*   r+   Ú#collective_reduce_v3_eager_fallbackr-   r3   r4   r5   r6   r7   r8   r9   r:   r<   r=   )r   r]   r^   rº   r   r   r?   r@   rA   rB   rD   rE   rF   rG   rH   rI   rI   rJ   Úcollective_reduce_v3&  s\   
ý€ÿþÿü
þÿr½   zraw_ops.CollectiveReduceV3c              
   C   sÀ   t  |d¡}|d u rd}t  |d¡}t  | g|tjtjtjtjtj	tj
g¡\}\} t |tj¡}t |tj	¡}| ||g}d|d|d|f}	t jdd||	||d}
t  ¡ r[t  d||	|
¡ |
\}
|
S )	Nrº   r   r   r!   s   CollectiveReduceV3rL   rM   r»   )r3   r4   r5   rO   rP   rQ   rR   rS   rT   rU   rV   r)   rW   rY   r   r8   r=   )r   r]   r^   rº   r   r   r   r[   rH   rG   rA   rI   rI   rJ   r¼   _  s(   .

ÿ
ÿÿr¼   )r   r   N)r   N)N)r   r   r§   N)gÚ__doc__ÚcollectionsZtensorflow.pythonr   Ztensorflow.python.eagerr   r#   r   r'   r   r3   Ztensorflow.python.frameworkr   rP   Ztensorflow.security.fuzzing.pyr   Z_atypesr   Z_op_def_registryr	   r)   r
   r6   Z"tensorflow.python.util.deprecationr   Ztensorflow.python.utilr   Ú	_dispatchZ tensorflow.python.util.tf_exportr   Útypingr   r   ZBFloat16ZFloat32ZFloat64ZHalfZInt32ZInt64r   ZTensorFuzzingAnnotationÚResourceÚstrÚfloatrK   Z	to_raw_opr   r,   r\   ra   r_   r`   Ú
namedtuplere   rh   rb   rg   ZBoolrj   Úintrq   rk   rm   rr   rs   rw   rt   rv   rx   r   rz   r}   rƒ   r†   r„   r…   r‡   rŠ   rˆ   r‰   r‹   r   rŒ   rŽ   r“   r‘   r’   r”   r¥   r—   r¤   r¦   r°   rª   r®   r´   r¸   rµ   r·   r¹   r½   r»   r¼   rI   rI   rI   rJ   Ú<module>   s”     \CZ <1:þ0/. .G, P=N 4F2 L;J4F2\BZD8B D[: (hTf %hSf $@6B