
    AVh	                    8   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#  edddddddddddddddd d!d"d#d$d%      Z$dhd&e#e!e$f   d'e#e!ejJ                  f   d(e&d)e&d*e&d+e#e!e$f   fd,Z'  ed-       ejP                  e'            Z)d&e#e!e$f   d'e#e!ejJ                  f   d(e&d)e&d*e&d+e#e!e$f   fd.Z* ed/ Z+g dfd0e#e!ejX                  f   d1e#e e!   e+f   fd2Z-  ed3       ejP                  e-            Z.d0e#e!ejX                  f   d1e#e e!   e+f   fd4Z/ ed5dddddddddddddd d!d"d#d$d%      Z0dhd&e#e!e0f   d6e#e!ejJ                  f   d+e#e!e0f   fd7Z1  ed8       ejP                  e1            Z2d&e#e!e0f   d6e#e!ejJ                  f   d+e#e!e0f   fd9Z3did=e4d>e4d?e5d@e5dAe5dBe&d+e#e!ejl                  f   fdCZ7  edD       ejP                  e7            Z8d=e4d>e4d?e5d@e5dAe5dBe&d+e#e!ejl                  f   fdEZ9dhdFe4fdGZ:  edH       ejP                  e:            Z;dFe4fdIZ< edJdddddd#      Z=dhd&e#e!e=f   d'e#e!ejJ                  f   d+e#e!e=f   fdKZ>  edL       ejP                  e>            Z?d&e#e!e=f   d'e#e!ejJ                  f   d+e#e!e=f   fdMZ@ edNdd      ZA edOdd      ZB edPdd      ZCg dfdQe#e e!   eAf   dRe#e e!   eBf   dSe#e e!   eCf   dTe#e!ejl                  f   dUe#e!ejJ                  f   f
dVZD  edW       ejP                  eD            ZEdQe#e e!   eAf   dRe#e e!   eBf   dSe#e e!   eCf   dTe#e!ejl                  f   dUe#e!ejJ                  f   f
dXZF edYdd      ZG edZdd      ZH ed[dd      ZIg g g dfd\e#e e!   eGf   dRe#e e!   eHf   dSe#e e!   eIf   dTe#e!ejl                  f   dUe#e!ejJ                  f   f
d]ZJ  ed^       ejP                  eJ            ZKd\e#e e!   eGf   dRe#e e!   eHf   dSe#e e!   eIf   dTe#e!ejl                  f   dUe#e!ejJ                  f   f
d_ZL ed`dd      ZM edadd      ZN edbdd      ZOdcg dfdQe#e e!   eMf   dRe#e e!   eNf   dSe#e e!   eOf   dTe#e!ejl                  f   dUe&f
ddZP  ede       ejP                  eP            ZQdQe#e e!   eMf   dRe#e e!   eNf   dSe#e e!   eOf   dTe#e!ejl                  f   dUe&f
dfZRdjdge#e e!   ejJ                  f   dTe#e!ejl                  f   dUe&fdhZS  edi       ejP                  eS            ZTdge#e e!   ejJ                  f   dTe#e!ejl                  f   dUe&fdjZU edkdd      ZV edldd      ZW edmdd      ZXdcg g g dfd\e#e e!   eVf   dRe#e e!   eWf   dSe#e e!   eXf   dTe#e!ejl                  f   dUe&f
dnZY  edo       ejP                  eY            ZZd\e#e e!   eVf   dRe#e e!   eWf   dSe#e e!   eXf   dTe#e!ejl                  f   dUe&f
dpZ[ edqdd      Z\ edrdd      Z] edsdd      Z^dcg dfdte#e e!   e\f   dRe#e e!   e]f   dSe#e e!   e^f   dTe#e!ejl                  f   dUe&f
duZ_  edv       ejP                  e_            Z`dte#e e!   e\f   dRe#e e!   e]f   dSe#e e!   e^f   dTe#e!ejl                  f   dUe&f
dwZa edxdd      Zb edydd      Zc edzdd      Zddcg g g dfdte#e e!   ebf   dRe#e e!   ecf   dSe#e e!   edf   dTe#e!ejl                  f   dUe&f
d{Ze  ed|       ejP                  ee            Zfdte#e e!   ebf   dRe#e e!   ecf   dSe#e e!   edf   dTe#e!ejl                  f   dUe&f
d}Zg ed~ Zhdhdehd+e#e!ehf   fdZi  ed       ejP                  ei            Zjdehd+e#e!ehf   fdZkdhdZl  ed       ejP                  el            Zmd Zn ed Zog g dcdfd&e#e!eof   dUe&fdZp  ed       ejP                  ep            Zqd&e#e!eof   dUe&fdZrdjd&e#e!ej                  f   dUe&fdZt  ed       ejP                  et            Zud&e#e!ej                  f   dUe&fdZvg dcdfdUe&fdZw  ed       ejP                  ew            ZxdUe&fdZydkdFe4d+e#e!ej                  f   fdZ{  ed       ejP                  e{            Z|dFe4d+e#e!ej                  f   fdZ}dlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZ  ed       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdÄZ  edī       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdńZdlde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdƄZ  edǫ       ejP                  e            Zde#e!ej                  f   de#e!ej                  f   de#e!ej                  f   de&de&de&de4dFe4fdȄZdlde#e!ej                  f   de&de&de&de4dFe4fdɄZ  edʫ       ejP                  e            Zde#e!ej                  f   de&de&de&de4dFe4fd˄Z ed̎ ZdjdedUe&d+e#e!ef   fd̈́Z  edΫ       ejP                  e            ZdedUe&d+e#e!ef   fdτZdjdUe&fdЄZ  edѫ       ejP                  e            ZdUe&fd҄ZdhdUe#e!ejJ                  f   fdӄZ  edԫ       ejP                  e            ZdUe#e!ejJ                  f   fdՄZ ed֎ ZdhdUe#e!ejJ                  f   ded+e#e!ef   fdׄZ  edث       ejP                  e            ZdUe#e!ejJ                  f   ded+e#e!ef   fdلZ edڎ Zdhd&e#e!ef   fdۄZ  edܫ       ejP                  e            Zd&e#e!ef   fd݄ZdhdބZ  ed߫       ejP                  e            Zd Z ed Zg g dfd&e#e!ef   d+e#e!ej                  f   fdZ  ed       ejP                  e            Zd&e#e!ef   d+e#e!ej                  f   fdZg dfd+e#e!ej                  f   fdZ  ed       ejP                  e            Zd+e#e!ej                  f   fdZ ed Zg dfd0e#e!ejX                  f   dede&fdZ  ed       ejP                  eë            Zd0e#e!ejX                  f   dede&fdZŐdhde&dFe4fdZ  ed       ejP                  eƫ            Zde&dFe4fdZ ej                  dg d      Zʐdlde&de&de&de4dFe4f
dZ  ed       ejP                  e˫            Zde&de&de&de4dFe4f
dZ ej                  dg d      Zΐdlde&de&de&de4dFe4f
dZ  ed       ejP                  eϫ            Zde&de&de&de4dFe4f
dZ ej                  dg d      ZҐdlde&de&de&de4dFe4f
dZ  ed       ejP                  eӫ            Zde&de&de&de4dFe4f
d Z ej                  dddg      Z֐dlde&de&de&de4dFe4f
dZ  ed       ejP                  e׫            Zde&de&de&de4dFe4f
dZ ej                  dg d      Zڐdlde&de&de&de4dFe4f
dZ  ed       ejP                  e۫            Zde&de&de&de4dFe4f
d	Z ej                  d
g d      Zސdlde&de&de&de4dFe4f
dZ  ed       ejP                  e߫            Zde&de&de&de4dFe4f
dZ ej                  dddg      Zdlde&de&de&de4dFe4f
dZ  ed       ejP                  e            Zde&de&de&de4dFe4f
dZ ej                  dg d      Zdlde&de&de&de4dFe4f
dZ  ed       ejP                  e            Zde&de&de&de4dFe4f
dZ ej                  dddg      Zdlde&de&de&de4dFe4f
dZ  ed       ejP                  e            Zde&de&de&de4dFe4f
dZ ej                  dddg      Zdlde&de&de&de4dFe4f
dZ  ed       ejP                  e            Zde&de&de&de4dFe4f
dZ ej                  d g d!      Zdlde&de&de&de4dFe4f
d"Z  ed#       ejP                  e            Zde&de&de&de4dFe4f
d$Z ej                  d%g d&      Zdlde&de&de&de4dFe4f
d'Z  ed(       ejP                  e            Zde&de&de&de4dFe4f
d)Zdlde&de&de&de4dFe4d+e#e!ej                  f   fd*Z  ed+       ejP                  e            Zde&de&de&de4dFe4d+e#e!ej                  f   fd,Zdhd1e#e e!   ej                  f   d-e#e e!   ej                  f   dFe4fd.Z  ed/       ejP                  e            Zd1e#e e!   ej                  f   d-e#e e!   ej                  f   dFe4fd0Zdhd1Z   ed2       ejP                  e             Zd3 Zdhd+e#e!ejl                  f   fd4Z  ed5       ejP                  e            Zd+e#e!ejl                  f   fd6Zdhd7e#e!ej                  f   d8e#e!ej                  f   de&d9e&d+e#e!ej                  f   f
d:Z  ed;       ejP                  e            Zd7e#e!ej                  f   d8e#e!ej                  f   de&d9e&d+e#e!ej                  f   f
d<Zdhd+e#e!ejJ                  f   fd=Z	  ed>       ejP                  e	            Z
d+e#e!ejJ                  f   fd?ZdmdUe#e!ejJ                  f   d@e&fdAZ  edB       ejP                  e            ZdUe#e!ejJ                  f   d@e&fdCZdDd:d<g g g g dEd;d;d:dfdFe&dGe&dHe4dIe5dJe4dKe5dLe5dMe4fdNZ  edO       ejP                  e            ZdFe&dGe&dHe4dIe5dJe4dKe5dLe5dMe4fdPZ edQ Zdnd1e#e e!   ef   dRe5dSe&dTe5d+e#e!ef   f
dUZ  edV       ejP                  e            Zd1e#e e!   ef   dRe5dSe&dTe5d+e#e!ef   f
dWZ edX Zdhd&e#e!ef   dFe&fdYZ  edZ       ejP                  e            Zd&e#e!ef   dFe&fd[Zdhd\e#e!ejl                  f   d+e#e!ejl                  f   fd]Z  ed^       ejP                  e            Zd\e#e!ejl                  f   d+e#e!ejl                  f   fd_Z ed` Zg dfd1e#e e!   ef   d+e#e!ef   fdaZ  edb       ejP                  e            Zd1e#e e!   ef   d+e#e!ef   fdcZ  edd Z!g dfd&e#e!e!f   de&fdeZ"  edf       ejP                  e"            Z#d&e#e!e!f   de&fdgZ$y(o  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TV_AllToAll_T_atypes.BFloat16_atypes.Bool_atypes.Complex128_atypes.Complex64_atypes.Float32_atypes.Float64_atypes.Half_atypes.Int16_atypes.Int32_atypes.Int64_atypes.Int8_atypes.QInt16_atypes.QInt32_atypes.QInt8_atypes.QUInt16_atypes.QUInt8_atypes.UInt16_atypes.UInt32_atypes.UInt64_atypes.UInt8inputgroup_assignmentconcat_dimensionsplit_dimensionsplit_countreturnc                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |d|d|d|      }|S t        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                   d| |||||      \  }
}
}}|dd }t        j"                         rjd|j%                  d      d|j'                  d      d|j'                  d      d|j'                  d      f}|j(                  }t        j*                  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)	a  An Op to exchange data across TPU replicas.

  On each replica, the input is split into `split_count` blocks along
  `split_dimension` and send to the other replicas given group_assignment. After
  receiving `split_count` - 1 blocks from other replicas, we concatenate the
  blocks along `concat_dimension` as the output.

  For example, suppose there are 2 TPU replicas:
  replica 0 receives input: `[[A, B]]`
  replica 1 receives input: `[[C, D]]`

  group_assignment=`[[0, 1]]`
  concat_dimension=0
  split_dimension=1
  split_count=2

  replica 0's output: `[[A], [C]]`
  replica 1's output: `[[B], [D]]`

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`, `bool`.
      The local input to the sum.
    group_assignment: A `Tensor` of type `int32`. An int32 tensor with shape
      [num_groups, num_replicas_per_group]. `group_assignment[i]` represents the
      replica ids in the ith subgroup.
    concat_dimension: An `int`. The dimension number to concatenate.
    split_dimension: An `int`. The dimension number to split.
    split_count: An `int`.
      The number of splits, this number must equal to the sub-group
      size(group_assignment.get_shape()[1])
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  AllToAllr*   r+   r,   N)r*   r+   r,   namectx)r(   r)   r*   r+   r,   r0   T)_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackExceptionall_to_all_eager_fallback_SymbolicException_executemake_int_op_def_library_apply_op_helpermust_record_gradient_get_attr_type_get_attr_intinputsrecord_gradient)r(   r)   r*   r+   r,   r0   _ctxtld_resulte__op_outputs_attrs_inputs_flats                  Q/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_tpu_ops.py
all_to_allrQ      s   H 
			0h..0$#\\	11j$'79K+_mg n &&'79KL%%o7HI/!!+}=+'88%2B%5$3	!QX
 QK'""$3%%c*,> 235F 12M.0F ::LL&'3('	.= && -
##At,,## 
&
!4D){  ## 
s0     E F E;;FFF* *G Gzraw_ops.AllToAllc                    t        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                  | g|t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  t        j,                  t        j.                  g      \  }\  } t1        j2                  |t        j                        }| |g}d|d|d|d|f}	t        j4                  dd||	||      }
t        j6                         rt        j8                  d||	|
       |
\  }
|
S )	Nr*   r+   r,   r2   s   AllToAll   rE   attrsr1   r0   r/   )r>   r?   args_to_matching_eager_dtypesfloat32float64int32uint8int16int8	complex64int64qint8quint8qint32bfloat16qint16quint16uint16
complex128halfuint32uint64boolr9   convert_to_tensorr   rB   rF   )r(   r)   r*   r+   r,   r0   r1   _attr_TrO   rN   rI   s              rP   r<   r<   k   se   &&'79KL%%o7HI/!!+}=+55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  ct  ct  v}  vC  vC  EL  ER  ER  T[  Tb  Tb  dk  dr  dr  t{  tD  tD  FM  FT  FT  V]  Ve  Ve  gn  gu  gu  w~  wI  wI  KR  KW  KW  Y`  Yg  Yg  ip  iw  iw  y@  yE  yE  EH  I'8E++,<gmmL)*,,.>_m[B&[!L#)s?'""$L&'3('	.    ) TV_AssignVariableXlaConcatND_Tr   r   r   r   _atypes.Float16r   r   _atypes.Float8e4m3b11fnuz_atypes.Float8e4m3fn_atypes.Float8e4m3fnuz_atypes.Float8e5m2_atypes.Float8e5m2fnuzr   r   r   _atypes.Int4r   r   r   r    r!   r"   r#   _atypes.Resource_atypes.Stringr$   r%   _atypes.UInt4r&   r'   _atypes.VariantresourcerE   c                    t         j                   xs t        j                         }|j                  }|j                  r 	 t	        j
                  |d|| |d|d|	      }|S t        |t        t        f      st!        d|z        t#        |      }	t        |t        t        f      st!        d|z        |D 
cg c]  }
t%        j&                  |
d       }}
|g }t        |t        t        f      st!        d|z        |D 
cg c]  }
t%        j&                  |
d       }}
t)        j*                  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 Uw xY wc c}
w c c}
w )
a5  Concats input tensor across all dimensions.

  An op which merges slices the input tensor based on the given num_splits
  attribute, strips paddings optionally, and writes the merged tensor without
  paddings to the resource variable.

  This op may be generated via the TPU bridge.

  For example, with `input` tensor:
  ```
  [[0, 1],
   [4, 5]]
  [[2, 3],
   [6, 7]]
  [[8, 9],
   [12, 13]]
  [[10, 11],
   [14, 15]]
  ```
  `num_splits`:
  ```
  [2, 2]
  ```
  and `paddings`:
  ```
  [1, 1]
  ```
  the expected `outputs` is:
  ```
  [[0, 1, 2],
   [4, 5, 6],
   [8, 9, 10]]
  ```

  Args:
    resource: A `Tensor` of type `resource`.
      Resource variable for concatenated input tensors across all dimensions.
    inputs: A list of at least 1 `Tensor` objects with the same type.
      Input tensor slices in row-major order to merge across all dimensions. All
      inputs must have the same shape.
    num_concats: A list of `ints`. Number of ways to merge per dimension.
    paddings: An optional list of `ints`. Defaults to `[]`.
      Optional list of right paddings per dimension to strip from the final merged
      tensor. These paddings must not exceed the dimension size of the merged result
      prior to stripping paddings.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  AssignVariableXlaConcatNDnum_concatspaddingsNr~   r   r0   r1   RExpected list for 'inputs' argument to 'assign_variable_xla_concat_nd' Op, not %r.WExpected list for 'num_concats' argument to 'assign_variable_xla_concat_nd' Op, not %r.TExpected list for 'paddings' argument to 'assign_variable_xla_concat_nd' Op, not %r.)r{   rE   r~   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   ,assign_variable_xla_concat_nd_eager_fallbackr=   
isinstancelisttuple	TypeErrorlenr>   r?   r@   rA   )r{   rE   r~   r   r0   rG   rH   rI   rJ   _attr_N_irK   rL   rM   s                 rP   assign_variable_xla_concat_ndr      s   f 
			0h..0$#\\11)46{J:g n 
FT5M	*
	68>	?@ @ K'	K$	/
	68C	DE E ALL"""2}5L+LH	HtUm	,
	68@	AB B ;CCBhJ/C(C'88#hv1<.6TC!QX 
*A && -
##At,,## 
9
Fh  ## 
 M Ds<    E 6F8F=F	E00F	F	F F54F5z!raw_ops.AssignVariableXlaConcatNDc                    t        |t        t        f      st        d|z        t	        |      }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  t        |      |g       \  }}t        j                  | t        j                        } | gt        |      z   }	d|d|d|d|f}
t        j                  dd	|	|
||
      }d }|S c c}w c c}w )Nr   r   r~   r   r   r2   Ns   AssignVariableXlaConcatNDr   rT   )r   r   r   r   r   r>   r?   rV   r9   rl   rW   r{   r   )r{   rE   r~   r   r0   r1   r   r   rm   rO   rN   rI   s               rP   r   r      ss   	FT5M	*
	68>	?@ @ K'	K$	/
	68C	DE E ALL"""2}5L+LH	HtUm	,
	68@	AB B ;CCBhJ/C(C33DL#rJ/'6##Hg.>.>?(d6l*,#w{h&91$0C"&(' '	.# M Ds   E#ETV_CollectivePermute_Tsource_target_pairsc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  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)a+  An Op to permute tensors across replicated TPU instances.

  Each instance supplies its own input.

  For example, suppose there are 4 TPU instances: `[A, B, C, D]`. Passing
  source_target_pairs=`[[0,1],[1,2],[2,3],[3,0]]` gets the outputs:
  `[D, A, B, C]`.

  Args:
    input: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `complex64`, `int64`, `qint8`, `quint8`, `qint32`, `bfloat16`, `qint16`, `quint16`, `uint16`, `complex128`, `half`, `uint32`, `uint64`.
      The local input to be permuted. Currently only supports float and
      bfloat16.
    source_target_pairs: A `Tensor` of type `int32`.
      A tensor with shape [num_pairs, 2].
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  CollectivePermuteNr0   r1   )r(   r   r0   r2   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   !collective_permute_eager_fallbackr=   r@   rA   r>   rB   rC   rE   rF   )r(   r   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s               rP   collective_permuter      sE   ( 
			0h..0$#\\11!40CEgn (8851D"&(!QX QK'""$3%%c*+F::L\67<('	.+ && -
##At,,## 
.
$4T; ;## 
0    C D"C==DDD) )D?>D?zraw_ops.CollectivePermutec                 h   t        j                  | g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                  t        j                   t        j"                  t        j$                  t        j&                  t        j(                  t        j*                  g      \  }\  } t-        j.                  |t        j
                        }| |g}d|f}t        j0                  dd||||      }t        j2                         rt        j4                  d|||       |\  }|S )Nr2   s   CollectivePermuterS   rT   r   )r>   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   r9   rl   r   rB   rF   )r(   r   r0   r1   rm   rO   rN   rI   s           rP   r   r   3  s   55ugsW__V]VeVegngtgtv}  wD  wD  FM  FS  FS  U\  Ua  Ua  cj  ct  ct  v}  vC  vC  EL  ER  ER  T[  Tb  Tb  dk  dr  dr  t{  tD  tD  FM  FT  FT  V]  Ve  Ve  gn  gu  gu  w~  wI  wI  KR  KW  KW  Y`  Yg  Yg  ip  iw  iw  Ez  {'8E../BGMMR,-,>&11\#)s?'""$\67<('	.rn    FTembedding_configtpu_embedding_configis_global_initenable_whole_mesh_compilations compilation_failure_closes_chipstpu_cancellation_closes_chipsc                    t         j                   xs t        j                         }|j                  }|j                  r&	 t	        j
                  |d|d| d|d|d|d|d|      }	|	S | d
} t        j                  | d      } |d
}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                   |d      }t#        j$                  d| ||||||      \  }}}}|dd }	t        j&                         rd|j)                  d      d|j)                  d      d|j+                  d      d|j+                  d      d|j+                  d      d|j-                  d      f}|j.                  }t        j0                  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)a  Sets up the centralized structures for a distributed TPU system.

  Args:
    embedding_config: An optional `string`. Defaults to `""`.
      Reserved. Do not use.
    tpu_embedding_config: An optional `string`. Defaults to `""`.
      Serialized tensorflow.tpu.TPUEmbeddingConfiguration that
      describes the embedding lookups of the program.
    is_global_init: An optional `bool`. Defaults to `False`.
      Reserved. Do not use.
    enable_whole_mesh_compilations: An optional `bool`. Defaults to `False`.
    compilation_failure_closes_chips: An optional `bool`. Defaults to `True`.
    tpu_cancellation_closes_chips: An optional `int`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `string`.
  ConfigureDistributedTPUr   r   r   r   r   r   N)r   r   r   r   r   r   r0   r1   r   FTr   )r   r   r   r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   (configure_distributed_tpu_eager_fallbackr=   r>   make_str	make_boolr?   r@   rA   rB   get_attr_get_attr_boolrD   rE   rF   )r   r   r   r   r   r   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s                   rP   configure_distributed_tpur   A  s   & 
			0h..0$#\\11'/A02F.*J&(J(*I%'g n" &&'79KL!!**+?AWXN%%n6FG.#+%*"#+#5#56TVv#w %-'+$%-%7%78XZ|%}""*$%!"*"3"34QSr"s'88!4D8L2@B`DdA^(,.!QX QK'""$ #,,/A"B$cll3I&J 2 23C D.  !AB0  !CD- ?@BF ::L!<B('	.s && -
##At,,## 

5+3')G+K(E  ## 
s0    $G H!G<<HHH, ,IIzraw_ops.ConfigureDistributedTPUc                    | d} t        j                  | d      } |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d	}t        j                  |d
      }g }d| d|d|d|d|d
|f}	t        j                  dd||	||      }
t        j
                         rt        j                  d||	|
       |
\  }
|
S )Nr   r   r   Fr   r   Tr   r   r   s   ConfigureDistributedTPUrS   rT   r   )r>   r   r   r?   r   rB   rF   )r   r   r   r   r   r   r0   r1   rO   rN   rI   s              rP   r   r     sH   &&'79KL!!**+?AWXN%%n6FG.#+%*"#+#5#56TVv#w %-'+$%-%7%78XZ|%}""*$%!"*"3"34QSr"s, 02H(."$B$&F!#@	B&
 7$0C"&(' ""$!<B('	.rn   configc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d|       }|S t        j                  | d      } t        j                   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)a   Sets up TPUEmbedding in a distributed TPU system.

  Args:
    config: A `string`.
      Serialized tensorflow.tpu.TPUEmbeddingConfiguration that
      describes the embedding lookups of the program.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  ConfigureTPUEmbeddingr   Nr   r0   r1   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   &configure_tpu_embedding_eager_fallbackr=   r>   r   r@   rA   )	r   r0   rG   rH   rI   rJ   rK   rL   rM   s	            rP   configure_tpu_embeddingr     s     
			0h..0$#\\11%tXv?gn VX.&'88T;!QX	* && -
##At,,## 
3d. .## 
s0    B C#B>>CCC) )C?>C?zraw_ops.ConfigureTPUEmbeddingc                 x    t        j                  | d      } g }d| f}t        j                  dd||||      }d }|S )Nr   s   ConfigureTPUEmbeddingr   rT   )r>   r   r   r   r0   r1   rO   rN   rI   s         rP   r   r     sK    VX.&,f&5q#)s?''	.rn   TV_CrossReplicaSum_Tc                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |      }|S t        j                  d| ||      \  }}}}	|	dd }t        j                          r7d|j#                  d      f}
|j$                  }t        j&                  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)aW  An Op to sum inputs across replicated TPU instances.

  Each instance supplies its own input.

  For example, suppose there are 8 TPU instances: `[A, B, C, D, E, F, G, H]`.
  Passing group_assignment=`[[0,2,4,6],[1,3,5,7]]` sets `A, C, E, G` as group 0,
  and `B, D, F, H` as group 1. Thus we get the outputs:
  `[A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H, A+C+E+G, B+D+F+H]`.

  Args:
    input: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`, `int32`, `uint32`.
      The local input to the sum.
    group_assignment: A `Tensor` of type `int32`. An int32 tensor with shape
      [num_groups, num_replicas_per_group]. `group_assignment[i]` represents the
      replica ids in the ith subgroup.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input`.
  CrossReplicaSumNr   )r(   r)   r0   r2   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;    cross_replica_sum_eager_fallbackr=   r@   rA   r>   rB   rC   rE   rF   )r(   r)   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s               rP   cross_replica_sumr     sE   * 
			0h..0$#\\11u.>@gn (889I $&!QX QK'""$3%%c*+F::L<:('	.) && -
##At,,## 
-
!$8 8## 
r   zraw_ops.CrossReplicaSumc           
         t        j                  | g|t        j                  t        j                  t        j
                  t        j                  t        j                  t        j                  g      \  }\  } t        j                  |t        j                        }| |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr2   s   CrossReplicaSumrS   rT   r   )r>   rV   rW   rh   rc   rX   rY   rZ   ri   r9   rl   r   rB   rF   )r(   r)   r0   r1   rm   rO   rN   rI   s           rP   r   r   &  s    55ugsW\\SZScSceletetv}  wF  wF  HO  HU  HU  W^  We  We  Eh  i'8E++,<gmmL)*,>&/<#)s?'""$<:('	.rn   4TV_DynamicEnqueueTPUEmbeddingArbitraryTensorBatch_T14TV_DynamicEnqueueTPUEmbeddingArbitraryTensorBatch_T24TV_DynamicEnqueueTPUEmbeddingArbitraryTensorBatch_T3sample_indices_or_row_splitsembedding_indicesaggregation_weightsmode_overridedevice_ordinalc                 "   t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| ||||d|
      }	|	S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        d	t#        |      |fz        |g }t        |t        t        f      st!        d
|z        |D cg c]  }t'        j(                  |d       }}t+        j,                  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 )a5  Eases the porting of code that uses tf.nn.embedding_lookup_sparse().

  embedding_indices[i] and aggregation_weights[i] correspond
  to the ith feature.

  The tensors at corresponding positions in the three input lists (sample_indices,
  embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1
  with dim_size() equal to the total number of lookups into the table described by
  the corresponding feature.

  Args:
    sample_indices_or_row_splits: A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 2 Tensors specifying the training example to which the
      corresponding embedding_indices and aggregation_weights values belong.
      If the size of its first dimension is 0, we assume each embedding_indices
      belongs to a different sample. Both int32 and int64 are allowed and will
      be converted to int32 internally.

      Or a list of rank 1 Tensors specifying the row splits for splitting
      embedding_indices and aggregation_weights into rows. It corresponds to
      ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When
      enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged.
      the row splits is 1-D dense tensor. When empty, we assume a dense tensor is
      passed to the op Both int32 and int64 are allowed and will be converted to
      int32 internally.
    embedding_indices: A list with the same length as `sample_indices_or_row_splits` of `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors, indices into the embedding
      tables. Both int32 and int64 are allowed and will be converted to
      int32 internally.
    aggregation_weights: A list with the same length as `sample_indices_or_row_splits` of `Tensor` objects with the same type in: `float32`, `float64`.
      A list of rank 1 Tensors containing per training
      example aggregation weights. Both float32 and float64 are allowed and will
      be converted to float32 internally.
    mode_override: A `Tensor` of type `string`.
      A string input that overrides the mode specified in the
      TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
      'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
      in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
    device_ordinal: A `Tensor` of type `int32`.
      The TPU device to use. Should be >= 0 and less than the number
      of TPU cores in the task on which the node is placed.
    combiners: An optional list of `strings`. Defaults to `[]`.
      A list of string scalars, one for each embedding table that specify
      how to normalize the embedding activations after weighted summation.
      Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have
      the sum of the weights be 0 for 'mean' or the sum of the squared weights be
      0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for
      all tables.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  .DynamicEnqueueTPUEmbeddingArbitraryTensorBatch	combinersN)r   r0   r1   Expected list for 'sample_indices_or_row_splits' argument to 'dynamic_enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.tExpected list for 'embedding_indices' argument to 'dynamic_enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.List argument 'embedding_indices' to 'dynamic_enqueue_tpu_embedding_arbitrary_tensor_batch' Op with length %d must match length %d of argument 'sample_indices_or_row_splits'.vExpected list for 'aggregation_weights' argument to 'dynamic_enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.List argument 'aggregation_weights' to 'dynamic_enqueue_tpu_embedding_arbitrary_tensor_batch' Op with length %d must match length %d of argument 'sample_indices_or_row_splits'.lExpected list for 'combiners' argument to 'dynamic_enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.r   r   r   r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   Cdynamic_enqueue_tpu_embedding_arbitrary_tensor_batch_eager_fallbackr=   r   r   r   r   r   
ValueErrorr>   r   r@   rA   r   r   r   r   r   r   r0   rG   rH   rI   rJ   r   _srK   rL   rM   s                   rP   4dynamic_enqueue_tpu_embedding_arbitrary_tensor_batchr   8  s   l 
			0h..0$#\\	11>$&79L~{I?g n 
04-	@
	MOk	lm m ,-'	%e}	5
	MO`	ab b 		w&
	K		)	*+ + 
'$	7
	MOb	cd d 		(
	K	 	!7+	,- - I	Ie}	-
	MOX	YZ Z =FFbx  [1F)F'888WsL]NaHUIWDM?CE!QX 
*e && -
##At,,## 
P
&(9
}nDd4 4 ## 
@ Gs6    F HG'GGGG2 2H	H	z6raw_ops.DynamicEnqueueTPUEmbeddingArbitraryTensorBatchc           
      B   t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        |g }t        |t        t        f      st        d|z        |D 	cg c]  }	t        j                  |	d       }}	t        j                  t        |       |t        j                  t        j                  gt        j                        \  }
} t        j                  t        |      |t        j                  t        j                  gt        j                        \  }}t        j                  t        |      |t        j                  t        j                  gt        j                        \  }}t        j                  |t        j                         }t        j                  |t        j                        }t        |       t        |      z   t        |      z   ||gz   }d|
d	|d
|d|d|f
}t        j"                  dd||||      }d }|S c c}	w )Nr   r   r   r   r   r   r   T1T2T3r   s.   DynamicEnqueueTPUEmbeddingArbitraryTensorBatchr   rT   )r   r   r   r   r   r   r>   r   rV   rW   rZ   r_   rX   rY   r9   rl   stringr   r   r   r   r   r   r   r0   r1   r   r   _attr_T1_attr_T2_attr_T3rO   rN   rI   s                   rP   r   r     s   	04-	@
	MOk	lm m ,-'	%e}	5
	MO`	ab b 		w&
	K		)	*+ + 
'$	7
	MOb	cd d 		(
	K	 	!7+	,- - I	Ie}	-
	MOX	YZ Z =FFbx  [1F)F+3+J+J4PlKmoru|  vC  vC  EL  ER  ER  uU  W^  Wd  Wd  ,e((( ( ? ?EV@WY\_f_l_lnun{n{^~  AH  AN  AN  !O("*"A"A$GZB[]`cjcrcrt{  uD  uD  cG  IP  IX  IX  #Y(((G-)).'--H.23d;L6MMPTUhPiimz  }K  mL  L,(D(D(Cy&N|6s"&(' '	. Gs   2J1TV_DynamicEnqueueTPUEmbeddingRaggedTensorBatch_T11TV_DynamicEnqueueTPUEmbeddingRaggedTensorBatch_T21TV_DynamicEnqueueTPUEmbeddingRaggedTensorBatch_T3sample_splitsc
                    t         j                   xs t        j                         }
|
j                  }|j                  r'	 t	        j
                  |
d|	| ||||d|d|d|d|      }|S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d	|z        t#        |      |k7  rt%        d
t#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j*                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}t-        j.                  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 c c}w c c}w c c}w )a'  TODO: add doc.

  Args:
    sample_splits: A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`.
    embedding_indices: A list with the same length as `sample_splits` of `Tensor` objects with the same type in: `int32`, `int64`.
    aggregation_weights: A list with the same length as `sample_splits` of `Tensor` objects with the same type in: `float32`, `float64`.
    mode_override: A `Tensor` of type `string`.
    device_ordinal: A `Tensor` of type `int32`.
    table_ids: A list of `ints`.
    combiners: An optional list of `strings`. Defaults to `[]`.
    max_sequence_lengths: An optional list of `ints`. Defaults to `[]`.
    num_features: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  +DynamicEnqueueTPUEmbeddingRaggedTensorBatchr   	table_idsmax_sequence_lengthsnum_featuresN)r   r   r   r   r0   r1   mExpected list for 'sample_splits' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.qExpected list for 'embedding_indices' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.List argument 'embedding_indices' to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op with length %d must match length %d of argument 'sample_splits'.sExpected list for 'aggregation_weights' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.List argument 'aggregation_weights' to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op with length %d must match length %d of argument 'sample_splits'.iExpected list for 'table_ids' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.iExpected list for 'combiners' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.tExpected list for 'max_sequence_lengths' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.lExpected list for 'num_features' argument to 'dynamic_enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.)
r   r   r   r   r   r   r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   @dynamic_enqueue_tpu_embedding_ragged_tensor_batch_eager_fallbackr=   r   r   r   r   r   r   r>   r?   r   r@   rA   )r   r   r   r   r   r   r   r   r   r0   rG   rH   rI   rJ   r   r   r   rK   rL   rM   s                       rP   1dynamic_enqueue_tpu_embedding_ragged_tensor_batchr     s   $ 
			0h..0$#\\11;T(*=}YY 4ng n 
MD%=	1
	JLY	Z[ [ '	%e}	5
	JL]	^_ _ 		w&
	<		)	*+ + 
'$	7
	JL_	`a a 		(
	<	 	!7+	,- - 
Ie}	-
	JLU	VW W =FFbx  [1F)FI	Ie}	-
	JLU	VW W =FFbx  [1F)F!	(4-	8
	JL`	ab b SggB(++B0FGggL	L4-	0
	JLX	YZ Z COOB(##B7O,O'885]IZK^ERFTAJAJL`DP<@
B!QX 
*S && -
##At,,## 
M
*,?
94H#$D	: :
 ## 
< G G h PsH    %I: K5K:)K?4L:KJ((K KK K21K2z3raw_ops.DynamicEnqueueTPUEmbeddingRaggedTensorBatchc                 &   t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d	       }}|g }t        |t        t        f      st        d
|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  t        |       |
t        j                  t        j                  gt        j                        \  }} t        j                  t        |      |
t        j                  t        j                  gt        j                        \  }}t        j                  t        |      |
t        j                  t        j                  gt        j                        \  }}t        j                   |t        j"                        }t        j                   |t        j                        }t        |       t        |      z   t        |      z   ||gz   }d|d|d|d|d	|d|d|d|f}t        j$                  dd|||
|	      }d }|S c c}w c c}w c c}w c c}w )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s+   DynamicEnqueueTPUEmbeddingRaggedTensorBatchr   rT   r   r   r   r   r   r   r>   r?   r   rV   rW   rZ   r_   rX   rY   r9   rl   r   r   )r   r   r   r   r   r   r   r   r   r0   r1   r   r   r   r   r   r   rO   rN   rI   s                       rP   r   r   I  s   	MD%=	1
	JLY	Z[ [ '	%e}	5
	JL]	^_ _ 		w&
	<		)	*+ + 
'$	7
	JL_	`a a 		(
	<	 	!7+	,- - 
Ie}	-
	JLU	VW W =FFbx  [1F)FI	Ie}	-
	JLU	VW W =FFbx  [1F)F!	(4-	8
	JL`	ab b SggB(++B0FGggL	L4-	0
	JLX	YZ Z COOB(##B7O,O$;;D<OQTW^WdWdfmfsfsVvx  yF  yF  G(M ( ? ?EV@WY\_f_l_lnun{n{^~  AH  AN  AN  !O("*"A"A$GZB[]`cjcrcrt{  uD  uD  cG  IP  IX  IX  #Y(((G-)).'--H.m$t,='>>FYAZZ^km{]||,(D(D(Cy+y2H6& K|6s"&(' '	.G G G h Ps   .M?9NN	N-TV_EnqueueTPUEmbeddingArbitraryTensorBatch_T1-TV_EnqueueTPUEmbeddingArbitraryTensorBatch_T2-TV_EnqueueTPUEmbeddingArbitraryTensorBatch_T3c                 X   t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |||d|d|      }	|	S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d	|z        t#        |      |k7  rt%        d
t#        |      |fz        |d}t'        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j*                  |d       }}t-        j.                  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>  Eases the porting of code that uses tf.nn.embedding_lookup_sparse().

  embedding_indices[i] and aggregation_weights[i] correspond
  to the ith feature.

  The tensors at corresponding positions in the three input lists (sample_indices,
  embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1
  with dim_size() equal to the total number of lookups into the table described by
  the corresponding feature.

  Args:
    sample_indices_or_row_splits: A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 2 Tensors specifying the training example to which the
      corresponding embedding_indices and aggregation_weights values belong.
      If the size of its first dimension is 0, we assume each embedding_indices
      belongs to a different sample. Both int32 and int64 are allowed and will
      be converted to int32 internally.

      Or a list of rank 1 Tensors specifying the row splits for splitting
      embedding_indices and aggregation_weights into rows. It corresponds to
      ids.row_splits in embedding_lookup(), when ids is a RaggedTensor. When
      enqueuing N-D ragged tensor, only the last dimension is allowed to be ragged.
      the row splits is 1-D dense tensor. When empty, we assume a dense tensor is
      passed to the op Both int32 and int64 are allowed and will be converted to
      int32 internally.
    embedding_indices: A list with the same length as `sample_indices_or_row_splits` of `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors, indices into the embedding
      tables. Both int32 and int64 are allowed and will be converted to
      int32 internally.
    aggregation_weights: A list with the same length as `sample_indices_or_row_splits` of `Tensor` objects with the same type in: `float32`, `float64`.
      A list of rank 1 Tensors containing per training
      example aggregation weights. Both float32 and float64 are allowed and will
      be converted to float32 internally.
    mode_override: A `Tensor` of type `string`.
      A string input that overrides the mode specified in the
      TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
      'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
      in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. Should be >= 0 and less than the number
      of TPU cores in the task on which the node is placed.
    combiners: An optional list of `strings`. Defaults to `[]`.
      A list of string scalars, one for each embedding table that specify
      how to normalize the embedding activations after weighted summation.
      Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have
      the sum of the weights be 0 for 'mean' or the sum of the squared weights be
      0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for
      all tables.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  'EnqueueTPUEmbeddingArbitraryTensorBatchr   r   Nr   r   r0   r1   wExpected list for 'sample_indices_or_row_splits' argument to 'enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.lExpected list for 'embedding_indices' argument to 'enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.List argument 'embedding_indices' to 'enqueue_tpu_embedding_arbitrary_tensor_batch' Op with length %d must match length %d of argument 'sample_indices_or_row_splits'.nExpected list for 'aggregation_weights' argument to 'enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.List argument 'aggregation_weights' to 'enqueue_tpu_embedding_arbitrary_tensor_batch' Op with length %d must match length %d of argument 'sample_indices_or_row_splits'.r   dExpected list for 'combiners' argument to 'enqueue_tpu_embedding_arbitrary_tensor_batch' Op, not %r.r   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   ;enqueue_tpu_embedding_arbitrary_tensor_batch_eager_fallbackr=   r   r   r   r   r   r   r>   r?   r   r@   rA   r   s                   rP   ,enqueue_tpu_embedding_arbitrary_tensor_batchr     s   l 
			0h..0$#\\
117$&79L'	g
 n 
04-	@
	EGc	de e ,-'	%e}	5
	EGX	YZ Z 		w&
	K		)	*+ + 
'$	7
	EGZ	[\ \ 		(
	K	 	!7+	,- - N$$^5EF.I	Ie}	-
	EGP	QR R =FFbx  [1F)F'881PlEVGZANBP=F8<>!QX 
*k && -
##At,,## 
H
&(9
}^Dd4 4 ## 
F G6     F/ ,H'/G6GG65G6:H H$#H$z/raw_ops.EnqueueTPUEmbeddingArbitraryTensorBatchc                 0   t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        |d}t        j                  |d      }|g }t        |t        t        f      st        d|z        |D 	cg c]  }	t        j                  |	d	       }}	t        j                  t        |       |t        j                  t        j                  gt        j                        \  }
} t        j                  t        |      |t        j                  t        j                  gt        j                        \  }}t        j                  t        |      |t        j                  t        j                  gt        j                        \  }}t        j                   |t        j"                        }t        |       t        |      z   t        |      z   |gz   }d
|
d|d|d|d|d	|f}t        j$                  dd||||      }d }|S c c}	w )Nr   r   r   r   r   r   r   r   r   r   r   r   r   s'   EnqueueTPUEmbeddingArbitraryTensorBatchr   rT   r   r   s                   rP   r   r     s   	04-	@
	EGc	de e ,-'	%e}	5
	EGX	YZ Z 		w&
	K		)	*+ + 
'$	7
	EGZ	[\ \ 		(
	K	 	!7+	,- - N$$^5EF.I	Ie}	-
	EGP	QR R =FFbx  [1F)F+3+J+J4PlKmoru|  vC  vC  EL  ER  ER  uU  W^  Wd  Wd  ,e((( ( ? ?EV@WY\_f_l_lnun{n{^~  AH  AN  AN  !O("*"A"A$GZB[]`cjcrcrt{  uD  uD  cG  IP  IX  IX  #Y(((G-23d;L6MMPTUhPiimzl{{,(D(D(CNK<&G$0C"&(' '	. G   Jbatchc           	      v   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S t        | t        t        f      st!        d| z        t#        |       }|d}t%        j&                  |d      }t)        j*                  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)ai  An op that enqueues a list of input batch tensors to TPUEmbedding.

  Args:
    batch: A list of at least 1 `Tensor` objects with type `int32`.
      A list of 1D tensors, one for each embedding table, containing the
      indices into the tables.
    mode_override: A `Tensor` of type `string`.
      A string input that overrides the mode specified in the
      TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
      'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
      in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. Should be >= 0 and less than the number
      of TPU cores in the task on which the node is placed.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  EnqueueTPUEmbeddingIntegerBatchr   Nr   r0   r1   WExpected list for 'batch' argument to 'enqueue_tpu_embedding_integer_batch' Op, not %r.r   )r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   2enqueue_tpu_embedding_integer_batch_eager_fallbackr=   r   r   r   r   r   r>   r?   r@   rA   )r   r   r   r0   rG   rH   rI   rJ   r   rK   rL   rM   s               rP   #enqueue_tpu_embedding_integer_batchr  8  sT   ( 
			0h..0$#\\11/um.*g n 
ED%=	)
	<>C	DE E J'N$$^5EF.'88)9F:H04	6!QX
 
*1 && -
##At,,## 
?
~D  ## 
s0    C DC55DDD" "D87D8z'raw_ops.EnqueueTPUEmbeddingIntegerBatchc                    t        | t        t        f      st        d| z        t	        |       }|d}t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        |       |gz   }d|d|f}t        j                  dd||||      }d }|S )Nr  r   r   r   s   EnqueueTPUEmbeddingIntegerBatchr   rT   )r   r   r   r   r   r>   r?   r9   convert_n_to_tensorrW   rZ   rl   r   r   )	r   r   r   r0   r1   r   rO   rN   rI   s	            rP   r  r  p  s    	ED%=	)
	<>C	DE E J'N$$^5EF.

"
"5'--
8%((G-e.,*N;&?$0C"&(' '	.rn   *TV_EnqueueTPUEmbeddingRaggedTensorBatch_T1*TV_EnqueueTPUEmbeddingRaggedTensorBatch_T2*TV_EnqueueTPUEmbeddingRaggedTensorBatch_T3c
                 H   t         j                   xs t        j                         }
|
j                  }|j                  r(	 t	        j
                  |
d|	| |||d|d|d|d|d|      }|S t        | t        t        f      st!        d	| z        t#        |       }t        |t        t        f      st!        d
|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}|d}t'        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j*                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}t-        j.                  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 c c}w c c}w c c}w )a+  Eases the porting of code that uses tf.nn.embedding_lookup().

  sample_splits[i], embedding_indices[i] and aggregation_weights[i] correspond
  to the ith feature. table_ids[i] indicates which embedding table to look up ith
  feature.

  The tensors at corresponding positions in two of the input lists,
  embedding_indices and aggregation_weights, must have the same shape, i.e. rank 1
  with dim_size() equal to the total number of lookups into the table described by
  the corresponding feature.

  Args:
    sample_splits: A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors specifying the break points for splitting
      embedding_indices and aggregation_weights into rows.
      It corresponds to ids.row_splits in embedding_lookup(), when ids is a
      RaggedTensor.
    embedding_indices: A list with the same length as `sample_splits` of `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors, indices into the embedding tables.
      It corresponds to ids.values in embedding_lookup(), when ids is a RaggedTensor.
    aggregation_weights: A list with the same length as `sample_splits` of `Tensor` objects with the same type in: `float32`, `float64`.
      A list of rank 1 Tensors containing per training example
      aggregation weights. It corresponds to the values field of a RaggedTensor
      with the same row_splits as ids in embedding_lookup(), when ids is a
      RaggedTensor.
    mode_override: A `Tensor` of type `string`.
      A string input that overrides the mode specified in the
      TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
      'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
      in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
    table_ids: A list of `ints`.
      A list of integers specifying the identifier of the embedding table
      (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the
      corresponding input. The ith input is looked up using table_ids[i]. The size
      of the table_ids list must be equal to that of sample_indices,
      embedding_indices and aggregation_weights.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. Should be >= 0 and less than the number
      of TPU cores in the task on which the node is placed.
    combiners: An optional list of `strings`. Defaults to `[]`.
      A list of string scalars, one for each embedding table that specify
      how to normalize the embedding activations after weighted summation.
      Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have
      the sum of the weights be 0 for 'mean' or the sum of the squared weights be
      0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for
      all tables.
    max_sequence_lengths: An optional list of `ints`. Defaults to `[]`.
    num_features: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  $EnqueueTPUEmbeddingRaggedTensorBatchr   r   r   r   r   Nr   r   r   r   r   r0   r1   eExpected list for 'sample_splits' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.iExpected list for 'embedding_indices' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.List argument 'embedding_indices' to 'enqueue_tpu_embedding_ragged_tensor_batch' Op with length %d must match length %d of argument 'sample_splits'.kExpected list for 'aggregation_weights' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.List argument 'aggregation_weights' to 'enqueue_tpu_embedding_ragged_tensor_batch' Op with length %d must match length %d of argument 'sample_splits'.aExpected list for 'table_ids' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.r   aExpected list for 'combiners' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.lExpected list for 'max_sequence_lengths' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.dExpected list for 'num_features' argument to 'enqueue_tpu_embedding_ragged_tensor_batch' Op, not %r.)
r   r   r   r   r   r   r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   8enqueue_tpu_embedding_ragged_tensor_batch_eager_fallbackr=   r   r   r   r   r   r   r>   r?   r   r@   rA   )r   r   r   r   r   r   r   r   r   r0   rG   rH   rI   rJ   r   r   r   rK   rL   rM   s                       rP   )enqueue_tpu_embedding_ragged_tensor_batchr    s   l 
			0h..0$#\\114dM..+y+)+?&g n 
MD%=	1
	BDQ	RS S '	%e}	5
	BDU	VW W 		w&
	<		)	*+ + 
'$	7
	BDW	XY Y 		(
	<	 	!7+	,- - 
Ie}	-
	BDM	NO O =FFbx  [1F)FN$$^5EF.I	Ie}	-
	BDM	NO O =FFbx  [1F)F!	(4-	8
	BDX	YZ Z SggB(++B0FGggL	L4-	0
	BDP	QR R COOB(##B7O,O'88.mBSDW>K:C?M:CEY=I59
;!QX 
*Y && -
##At,,## 
E
*,?
)4H#$D	: :
 ## 
< G G h PH    &J L9LLLK(KKK K6 6LLz,raw_ops.EnqueueTPUEmbeddingRaggedTensorBatchc                    t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|d}t        j                  |d	      }|g }t        |t        t        f      st        d
|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  t        |       |
t        j                  t        j                  gt        j                        \  }} t        j                  t        |      |
t        j                  t        j                  gt        j                        \  }}t        j                  t        |      |
t        j                  t        j                  gt        j                        \  }}t        j                   |t        j"                        }t        |       t        |      z   t        |      z   |gz   }d|d|d|d|d	|d|d|d|d|f}t        j$                  dd|||
|	      }d }|S c c}w c c}w c c}w c c}w )Nr  r  r  r  r  r  r   r   r   r  r   r  r   r  r   r   r   r   r   s$   EnqueueTPUEmbeddingRaggedTensorBatchr   rT   r   )r   r   r   r   r   r   r   r   r   r0   r1   r   r   r   r   r   r   rO   rN   rI   s                       rP   r  r    s#   	MD%=	1
	BDQ	RS S '	%e}	5
	BDU	VW W 		w&
	<		)	*+ + 
'$	7
	BDW	XY Y 		(
	<	 	!7+	,- - 
Ie}	-
	BDM	NO O =FFbx  [1F)FN$$^5EF.I	Ie}	-
	BDM	NO O =FFbx  [1F)F!	(4-	8
	BDX	YZ Z SggB(++B0FGggL	L4-	0
	BDP	QR R COOB(##B7O,O$;;D<OQTW^WdWdfmfsfsVvx  yF  yF  G(M ( ? ?EV@WY\_f_l_lnun{n{^~  AH  AN  AN  !O("*"A"A$GZB[]`cjcrcrt{  uD  uD  cG  IP  IX  IX  #Y(((G-m$t,='>>FYAZZ^k]ll,(D(D(CNKK#%9>& Da$0C"&(' '	.M G G h P   .M6M;N )N$TV_EnqueueTPUEmbeddingSparseBatch_T1$TV_EnqueueTPUEmbeddingSparseBatch_T2$TV_EnqueueTPUEmbeddingSparseBatch_T3sample_indicesc                 X   t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |||d|d|      }	|	S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d	|z        t#        |      |k7  rt%        d
t#        |      |fz        |d}t'        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j*                  |d       }}t-        j.                  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#
  An op that enqueues TPUEmbedding input indices from a SparseTensor.

  This Op eases the porting of code that uses embedding_lookup_sparse(),
  although some Python preprocessing of the SparseTensor arguments to
  embedding_lookup_sparse() is required to produce the arguments to this Op,
  since only a single EnqueueTPUEmbeddingSparseBatch Op is allowed per training
  step.

  The tensors at corresponding positions in the three input lists
  must have the same shape, i.e. rank 1 with dim_size() equal to the total
  number of lookups into the table described by the corresponding table_id.

  Args:
    sample_indices: A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors specifying the training example and
      feature to which the corresponding embedding_indices and aggregation_weights
      values belong. sample_indices[i] must equal b * nf + f, where nf is the
      number of features from the corresponding table, f is in [0, nf), and
      b is in [0, batch size).
    embedding_indices: A list with the same length as `sample_indices` of `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors, indices into the embedding tables.
    aggregation_weights: A list with the same length as `sample_indices` of `Tensor` objects with the same type in: `float32`, `float64`.
      A list of rank 1 Tensors containing per sample -- i.e. per
      (training example, feature) -- aggregation weights.
    mode_override: A `Tensor` of type `string`.
      A string input that overrides the mode specified in the
      TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
      'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
      in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. Should be >= 0 and less than the number
      of TPU cores in the task on which the node is placed.
    combiners: An optional list of `strings`. Defaults to `[]`.
      A list of string scalars, one for each embedding table that specify
      how to normalize the embedding activations after weighted summation.
      Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have
      the sum of the weights be 0 for 'mean' or the sum of the squared weights be
      0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for
      all tables.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  EnqueueTPUEmbeddingSparseBatchr   r   Nr   _Expected list for 'sample_indices' argument to 'enqueue_tpu_embedding_sparse_batch' Op, not %r.bExpected list for 'embedding_indices' argument to 'enqueue_tpu_embedding_sparse_batch' Op, not %r.List argument 'embedding_indices' to 'enqueue_tpu_embedding_sparse_batch' Op with length %d must match length %d of argument 'sample_indices'.dExpected list for 'aggregation_weights' argument to 'enqueue_tpu_embedding_sparse_batch' Op, not %r.List argument 'aggregation_weights' to 'enqueue_tpu_embedding_sparse_batch' Op with length %d must match length %d of argument 'sample_indices'.r   ZExpected list for 'combiners' argument to 'enqueue_tpu_embedding_sparse_batch' Op, not %r.)r  r   r   r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   1enqueue_tpu_embedding_sparse_batch_eager_fallbackr=   r   r   r   r   r   r   r>   r?   r   r@   rA   )r  r   r   r   r   r   r0   rG   rH   rI   rJ   r   r   rK   rL   rM   s                   rP   "enqueue_tpu_embedding_sparse_batchr)  b  s   Z 
			0h..0$#\\	11.n..+yBg n 
NT5M	2
	;=K	LM M '	%e}	5
	;=N	OP P 		w&
	=		)	*+ + 
'$	7
	;=P	QR R 		(
	=	 	!7+	,- - N$$^5EF.I	Ie}	-
	;=F	GH H =FFbx  [1F)F'88(<M>Q8E9G4=DJ!QX 
*i && -
##At,,## 
>
+-@
)  ## 
F Gr   z&raw_ops.EnqueueTPUEmbeddingSparseBatchc                 0   t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        |d}t        j                  |d      }|g }t        |t        t        f      st        d|z        |D 	cg c]  }	t        j                  |	d	       }}	t        j                  t        |       |t        j                  t        j                  gt        j                        \  }
} t        j                  t        |      |t        j                  t        j                  gt        j                        \  }}t        j                  t        |      |t        j                  t        j                  gt        j                        \  }}t        j                   |t        j"                        }t        |       t        |      z   t        |      z   |gz   }d
|
d|d|d|d|d	|f}t        j$                  dd||||      }d }|S c c}	w )Nr"  r#  r$  r%  r&  r   r   r'  r   r   r   r   r   s   EnqueueTPUEmbeddingSparseBatchr   rT   r   )r  r   r   r   r   r   r0   r1   r   r   r   r   r   rO   rN   rI   s                   rP   r(  r(    s   	NT5M	2
	;=K	LM M '	%e}	5
	;=N	OP P 		w&
	=		)	*+ + 
'$	7
	;=P	QR R 		(
	=	 	!7+	,- - N$$^5EF.I	Ie}	-
	;=F	GH H =FFbx  [1F)F%<<T.=QSVY`YfYfhohuhuXx  {B  {H  {H  I(N ( ? ?EV@WY\_f_l_lnun{n{^~  AH  AN  AN  !O("*"A"A$GZB[]`cjcrcrt{  uD  uD  cG  IP  IX  IX  #Y(((G-n%->(??$GZB[[_l^mm,(D(D(CNK<&>$0C"&(' '	. Gr   *TV_EnqueueTPUEmbeddingSparseTensorBatch_T1*TV_EnqueueTPUEmbeddingSparseTensorBatch_T2*TV_EnqueueTPUEmbeddingSparseTensorBatch_T3c
                 H   t         j                   xs t        j                         }
|
j                  }|j                  r(	 t	        j
                  |
d|	| |||d|d|d|d|d|      }|S t        | t        t        f      st!        d	| z        t#        |       }t        |t        t        f      st!        d
|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        t#        |      |k7  rt%        dt#        |      |fz        t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}|d}t'        j(                  |d      }|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j*                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}|g }t        |t        t        f      st!        d|z        |D cg c]  }t'        j(                  |d       }}t-        j.                  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 c c}w c c}w c c}w )a  Eases the porting of code that uses tf.nn.embedding_lookup_sparse().

  sample_indices[i], embedding_indices[i] and aggregation_weights[i] correspond
  to the ith feature. table_ids[i] indicates which embedding table to look up ith
  feature.

  The tensors at corresponding positions in the three input lists (sample_indices,
  embedding_indices and aggregation_weights) must have the same shape, i.e. rank 1
  with dim_size() equal to the total number of lookups into the table described by
  the corresponding feature.

  Args:
    sample_indices: A list of at least 1 `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors specifying the training example to
      which the corresponding embedding_indices and aggregation_weights values
      belong. It corresponds to sp_ids.indices[:,0] in  embedding_lookup_sparse().
    embedding_indices: A list with the same length as `sample_indices` of `Tensor` objects with the same type in: `int32`, `int64`.
      A list of rank 1 Tensors, indices into the embedding tables.
      It corresponds to sp_ids.values in embedding_lookup_sparse().
    aggregation_weights: A list with the same length as `sample_indices` of `Tensor` objects with the same type in: `float32`, `float64`.
      A list of rank 1 Tensors containing per training example
      aggregation weights. It corresponds to sp_weights.values in
      embedding_lookup_sparse().
    mode_override: A `Tensor` of type `string`.
      A string input that overrides the mode specified in the
      TPUEmbeddingConfiguration. Supported values are {'unspecified', 'inference',
      'training', 'backward_pass_only'}. When set to 'unspecified', the mode set
      in TPUEmbeddingConfiguration is used, otherwise mode_override is used.
    table_ids: A list of `ints`.
      A list of integers specifying the identifier of the embedding table
      (offset of TableDescriptor in the TPUEmbeddingConfiguration) to lookup the
      corresponding input. The ith input is looked up using table_ids[i]. The size
      of the table_ids list must be equal to that of sample_indices,
      embedding_indices and aggregation_weights.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. Should be >= 0 and less than the number
      of TPU cores in the task on which the node is placed.
    combiners: An optional list of `strings`. Defaults to `[]`.
      A list of string scalars, one for each embedding table that specify
      how to normalize the embedding activations after weighted summation.
      Supported combiners are 'mean', 'sum', or 'sqrtn'. It is invalid to have
      the sum of the weights be 0 for 'mean' or the sum of the squared weights be
      0 for 'sqrtn'. If combiners isn't passed, the default is to use 'sum' for
      all tables.
    max_sequence_lengths: An optional list of `ints`. Defaults to `[]`.
    num_features: An optional list of `ints`. Defaults to `[]`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  $EnqueueTPUEmbeddingSparseTensorBatchr   r   r   r   r   Nr  fExpected list for 'sample_indices' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.iExpected list for 'embedding_indices' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.List argument 'embedding_indices' to 'enqueue_tpu_embedding_sparse_tensor_batch' Op with length %d must match length %d of argument 'sample_indices'.kExpected list for 'aggregation_weights' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.List argument 'aggregation_weights' to 'enqueue_tpu_embedding_sparse_tensor_batch' Op with length %d must match length %d of argument 'sample_indices'.aExpected list for 'table_ids' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.r   aExpected list for 'combiners' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.lExpected list for 'max_sequence_lengths' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.dExpected list for 'num_features' argument to 'enqueue_tpu_embedding_sparse_tensor_batch' Op, not %r.)
r  r   r   r   r   r   r   r   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   8enqueue_tpu_embedding_sparse_tensor_batch_eager_fallbackr=   r   r   r   r   r   r   r>   r?   r   r@   rA   )r  r   r   r   r   r   r   r   r   r0   rG   rH   rI   rJ   r   r   r   rK   rL   rM   s                       rP   )enqueue_tpu_embedding_sparse_tensor_batchr:    s   h 
			0h..0$#\\114dN..+y+)+?&g n 
NT5M	2
	BDR	ST T '	%e}	5
	BDU	VW W 		w&
	=		)	*+ + 
'$	7
	BDW	XY Y 		(
	=	 	!7+	,- - 
Ie}	-
	BDM	NO O =FFbx  [1F)FN$$^5EF.I	Ie}	-
	BDM	NO O =FFbx  [1F)F!	(4-	8
	BDX	YZ Z SggB(++B0FGggL	L4-	0
	BDP	QR R COOB(##B7O,O'88.~BSDW>K:C?M:CEY=I59
;!QX 
*Y && -
##At,,## 
E
+-@
)4H#$D	: :
 ## 
< G G h Pr  z,raw_ops.EnqueueTPUEmbeddingSparseTensorBatchc                    t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        t	        |      |k7  rt        dt	        |      |fz        t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|d}t        j                  |d	      }|g }t        |t        t        f      st        d
|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  t        |       |
t        j                  t        j                  gt        j                        \  }} t        j                  t        |      |
t        j                  t        j                  gt        j                        \  }}t        j                  t        |      |
t        j                  t        j                  gt        j                        \  }}t        j                   |t        j"                        }t        |       t        |      z   t        |      z   |gz   }d|d|d|d|d	|d|d|d|d|f}t        j$                  dd|||
|	      }d }|S c c}w c c}w c c}w c c}w )Nr0  r1  r2  r3  r4  r5  r   r   r   r6  r   r7  r   r8  r   r   r   r   r   s$   EnqueueTPUEmbeddingSparseTensorBatchr   rT   r   )r  r   r   r   r   r   r   r   r   r0   r1   r   r   r   r   r   r   rO   rN   rI   s                       rP   r9  r9    s'   	NT5M	2
	BDR	ST T '	%e}	5
	BDU	VW W 		w&
	=		)	*+ + 
'$	7
	BDW	XY Y 		(
	=	 	!7+	,- - 
Ie}	-
	BDM	NO O =FFbx  [1F)FN$$^5EF.I	Ie}	-
	BDM	NO O =FFbx  [1F)F!	(4-	8
	BDX	YZ Z SggB(++B0FGggL	L4-	0
	BDP	QR R COOB(##B7O,O%<<T.=QSVY`YfYfhohuhuXx  {B  {H  {H  I(N ( ? ?EV@WY\_f_l_lnun{n{^~  AH  AN  AN  !O("*"A"A$GZB[]`cjcrcrt{  uD  uD  cG  IP  IX  IX  #Y(((G-n%->(??$GZB[[_l^mm,(D(D(CNKK#%9>& Da$0C"&(' '	.M G G h Pr  ) TV_InfeedDequeue_dtyper   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   dtypec           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d| d|      }|S t        j                  | d      } t        j                  |d      }t!        j"                  d| ||      \  }}}}	|	dd }t        j$                         rHd|j'                  d      d|j)                  d      f}
|j*                  }t        j,                  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)a1  A placeholder op for a value that will be fed into the computation.

  Args:
    dtype: A `tf.DType`. The type of elements in the tensor.
    shape: A `tf.TensorShape` or list of `ints`. The shape of the tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  InfeedDequeuer=  shapeNr=  r@  r0   r1   )r=  r@  r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   infeed_dequeue_eager_fallbackr=   r>   	make_type
make_shaper@   rA   rB   rC   r   rE   rF   )r=  r@  r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s               rP   infeed_dequeuerE    sv    
			0h..0$#\\11otWeWeEgn 

UG
,%


eW
-%'88uE>!QXQK'""$s))'2Gll7#%F::Lvw8('	.- && -
##At,,## 
*U49 9## 
0    D E!D<<EEE( (E?>E?zraw_ops.InfeedDequeuec                    t        j                  | d      } t        j                  |d      }g }d| d|f}t        j                  dd||||      }t        j                         rt        j
                  d|||       |\  }|S )Nr=  r@  s   InfeedDequeuerS   rT   r?  )r>   rC  rD  r   rB   rF   )r=  r@  r0   r1   rO   rN   rI   s          rP   rB  rB    s    


UG
,%


eW
-%,UGU+&-q#)s?'""$vw8('	.rn   c           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d| d|      }|S t        | t        t        f      st!        d| z        | D cg c]  }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,                         rHd|
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 w xY wc c}w c c}w )	a  Fetches multiple values from infeed as an XLA tuple.

  Args:
    dtypes: A list of `tf.DTypes` that has length `>= 1`.
      The element types of each element in `outputs`.
    shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`).
      The shapes of each tensor in `outputs`.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `dtypes`.
  InfeedDequeueTupler   shapesNr   rJ  r0   r1   IExpected list for 'dtypes' argument to 'infeed_dequeue_tuple' Op, not %r.IExpected list for 'shapes' argument to 'infeed_dequeue_tuple' Op, not %r.)r   rJ  r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   #infeed_dequeue_tuple_eager_fallbackr=   r   r   r   r   r>   rC  rD  r@   rA   rB   r   rE   rF   )r   rJ  r0   rG   rH   rI   rJ   _tr   rK   rL   rM   rN   rO   s                 rP   infeed_dequeue_tuplerP    s    
			0h..0$#\\11"D(FHfNgn 
FT5M	*
	-/5	67 7 8>>Hr8,>&>	FT5M	*
	-/5	67 7 9??"HH-?&?'88VFG!QXQK'	J""$X.ll8$&F::LlFG=	.? && -
##At,,## 
0Tt= =## 
 ?
 @s<    E0 G$G)0F7FF76F7;G
 
G! G!zraw_ops.InfeedDequeueTuplec                    t        | t        t        f      st        d| z        | D cg c]  }t	        j
                  |d       } }t        |t        t        f      st        d|z        |D cg c]  }t	        j                  |d       }}g }d| d|f}t	        j                  dt        |       ||||      }t	        j                         rt	        j                  d|||       |S c c}w c c}w )NrL  r   rM  rJ  s   InfeedDequeueTuplerT   rI  )r   r   r   r   r>   rC  rD  r   r   rB   rF   )	r   rJ  r0   r1   rO  r   rO   rN   rI   s	            rP   rN  rN  M  s   	FT5M	*
	-/5	67 7 8>>Hr8,>&>	FT5M	*
	-/5	67 7 9??"HH-?&?,fh/&2CK$0C"&(' ""$lFG=	. ?
 @s   C)0C.) TV_InfeedEnqueue_dtyper   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S |g }t        j                  |d      }|g }t        |t         t"        f      st%        d|z        |D 	cg c]  }	t        j&                  |	d       }}	|d}t        j&                  |d      }t)        j*                  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 )
a1  An op which feeds a single Tensor value into the computation.

  Args:
    input: A `Tensor`.
      A tensor that will be provided using the infeed mechanism.
    shape: An optional `tf.TensorShape` or list of `ints`. Defaults to `[]`.
      The shape of the tensor.
    layout: An optional list of `ints`. Defaults to `[]`.
      A vector holding the requested layout in minor-to-major sequence.
      If a layout attribute is passed, but its values are all -1, the layout will
      be computed by the infeed operation.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. This should be -1 when the Op
      is running on a TPU device, and >= 0 when the Op is running on the CPU
      device.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  InfeedEnqueuer@  layoutr   N)r@  rU  r   r0   r1   CExpected list for 'layout' argument to 'infeed_enqueue' Op, not %r.r   )r(   r@  rU  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   infeed_enqueue_eager_fallbackr=   r>   rD  r   r   r   r   r?   r@   rA   )r(   r@  rU  r   r0   rG   rH   rI   rJ   r   rK   rL   rM   s                rP   infeed_enqueuerX  e  s   * 
			0h..0$#\\11otUGUHf.*g n ]E


eW
-%^F	FT5M	*
	')/	01 1 7==Hb(+=&=N$$^5EF.'88uE&(6TC!QX 
*7 && -
##At,,## 
*
uVN  ## 
 >s6    D &E7ED//EEE E43E4zraw_ops.InfeedEnqueuec                    |g }t        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|d}t        j                  |d      }t        j                  | g|g       \  }\  } | g}d|d|d|d|f}	t        j                  dd||	||	      }
d }
|
S c c}w )
Nr@  rV  rU  r   r   r=  s   InfeedEnqueuer   rT   )	r>   rD  r   r   r   r   r?   rV   r   )r(   r@  rU  r   r0   r1   r   _attr_dtyperO   rN   rI   s              rP   rW  rW    s    
]E


eW
-%^F	FT5M	*
	')/	01 1 7==Hb(+=&=N$$^5EF."995'3K+x,['5(FN$&-q#)s?''	. >s   C	c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|      }|S |d}t        j                  |d      }t        j                   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)a  An op which enqueues prelinearized buffer into TPU infeed.

  Args:
    input: A `Tensor` of type `variant`.
      A variant tensor representing linearized output.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. This should be -1 when the Op is running on a TPU device
      and = 0 when the Op is running on the CPU device.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
   InfeedEnqueuePrelinearizedBufferr   Nr  r   )r(   r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   2infeed_enqueue_prelinearized_buffer_eager_fallbackr=   r>   r?   r@   rA   )
r(   r   r0   rG   rH   rI   rJ   rK   rL   rM   s
             rP   #infeed_enqueue_prelinearized_bufferr^    s    
			0h..0$#\\110$.*g n N$$^5EF.'88*%;I157!QX 
*# && -
##At,,## 
?
TtE E## 
s0    B C)CCC!C0 0DDz(raw_ops.InfeedEnqueuePrelinearizedBufferc                     |d}t        j                  |d      }t        j                  | t        j
                        } | g}d|f}t        j                  dd||||      }d }|S )Nr   r   s    InfeedEnqueuePrelinearizedBufferr   rT   )r>   r?   r9   rl   rW   variantr   )r(   r   r0   r1   rO   rN   rI   s          rP   r]  r]    sr    N$$^5EF.

 
 
8%,n-&@!$0C"&(' '	.rn   c                 \   t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S t        |t        t        f      st!        d|z        |D 	cg c]  }	t#        j$                  |	d       }}	|g }t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j&                  |
d       }}
|d	}t#        j&                  |d      }t)        j*                  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 c c}
w )a  Feeds multiple Tensor values into the computation as an XLA tuple.

  Args:
    inputs: A list of `Tensor` objects.
      A list of tensors that will be provided using the infeed mechanism.
    shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`).
      The shapes of each tensor in `inputs`.
    layouts: An optional list of `ints`. Defaults to `[]`.
      A vector holding the requested layout in minor-to-major sequence for
      all the tuple shapes, in the order the shapes appear in the "shapes" input.
      The layout elements for a sub-shape can be set to -1, in which case the
      corresponding layout will be computed by the infeed operation.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. This should be -1 when the Op
      is running on a TPU device, and >= 0 when the Op is running on the CPU
      device.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  InfeedEnqueueTuplerJ  layoutsr   N)rJ  rc  r   r0   r1   IExpected list for 'shapes' argument to 'infeed_enqueue_tuple' Op, not %r.JExpected list for 'layouts' argument to 'infeed_enqueue_tuple' Op, not %r.r   )rE   rJ  rc  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   #infeed_enqueue_tuple_eager_fallbackr=   r   r   r   r   r>   rD  r?   r@   rA   )rE   rJ  rc  r   r0   rG   rH   rI   rJ   r   r   rK   rL   rM   s                 rP   infeed_enqueue_tuplerg    s   , 
			0h..0$#\\11"D&(FI!>3g n 
FT5M	*
	-/5	67 7 9??"HH-?&?_G	GdE]	+
	-/6	78 8 9@@"Xr9-@'@N$$^5EF.'88VFG-;$H!QX 
*; && -
##At,,## 
0
'd> > ## 
 @ As<    D. F$F).E5EE54E59F
 
F! F!zraw_ops.InfeedEnqueueTuplec                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }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d	|	|
||
      }d }|S c c}w c c}w )Nrd  rJ  re  rc  r   r   r   s   InfeedEnqueueTupler   rT   )	r   r   r   r   r>   rD  r?   convert_to_mixed_eager_tensorsr   )rE   rJ  rc  r   r0   r1   r   r   _attr_dtypesrO   rN   rI   s               rP   rf  rf  1  s,   	FT5M	*
	-/5	67 7 9??"HH-?&?_G	GdE]	+
	-/6	78 8 9@@"Xr9-@'@N$$^5EF.!@@M,f,lHfiN$&2Al#)s?''	.% @ As   C:4C?c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d|       }|S | d} t        j                  | d      } t        j                   d| |      \  }}}}|dd }t        j"                         r7d|j%                  d      f}	|j&                  }
t        j(                  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)zWhether TPU Embedding is initialized in a distributed TPU system.

  Args:
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `bool`.
  IsTPUEmbeddingInitializedr   Nr   r   r   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   +is_tpu_embedding_initialized_eager_fallbackr=   r>   r   r@   rA   rB   r   rE   rF   )r   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s              rP   is_tpu_embedding_initializedrn  K  sV    
			0h..0$#\\11)46Cgn ^FVX.&'88#F?!QXQK'""$X./F::L#\67D('	.- && -
##At,,## 
8d. .## 
s0    C( (D/;DD/.D/3E EEz!raw_ops.IsTPUEmbeddingInitializedc                     | d} t        j                  | d      } g }d| f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr   r   s   IsTPUEmbeddingInitializedrS   rT   rl  )r>   r   r   rB   rF   r   s         rP   rm  rm  w  s~    ^FVX.&,f&91$0C"&(' ""$#\67D('	.rn   
parametersmomenta
velocities
num_shardsshard_idtable_id
table_namec	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load ADAM embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the ADAM optimization algorithm.
    momenta: A `Tensor` of type `float32`.
      Value of momenta used in the ADAM optimization algorithm.
    velocities: A `Tensor` of type `float32`.
      Value of velocities used in the ADAM optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  LoadTPUEmbeddingADAMParametersru  rv  rs  rt  r   Nru  rv  rs  rt  r   r0   r1   r   r   )	rp  rq  rr  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   1load_tpu_embedding_adam_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  rq  rr  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                   rP   "load_tpu_embedding_adam_parametersr{    s   4 
			0h..0$#\\	11.j'J,
j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'88(Z295?5?3;3;5?17dD!QX 
*A && -
##At,,## 
>
gzHJd. . ## 
0    %D ED44EEE& &E=<E=z&raw_ops.LoadTPUEmbeddingADAMParametersc
           
      .   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| ||g}
d|d|d|d|d|f
}t        j                  dd	|
||	|
      }d }|S )Nrs  rt  r   ru  r   rv  r   s   LoadTPUEmbeddingADAMParametersr   rT   r>   r?   r   r9   rl   rW   rX   r   )rp  rq  rr  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                rP   rz  rz    s     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*""7GOO<'%%j'//B*gz2,,
Lj(Hf6&>$0C"&(' '	.rn   accumulatorsupdatesc	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load Adadelta embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the Adadelta optimization algorithm.
    accumulators: A `Tensor` of type `float32`.
      Value of accumulators used in the Adadelta optimization algorithm.
    updates: A `Tensor` of type `float32`.
      Value of updates used in the Adadelta optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  "LoadTPUEmbeddingAdadeltaParametersru  rv  rs  rt  r   Nry  r   r   )	rp  r  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   5load_tpu_embedding_adadelta_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                   rP   &load_tpu_embedding_adadelta_parametersr    s   4 
			0h..0$#\\	112D*gz8\:j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'88,;G6=9C7?7?9C5;$H!QX 
*A && -
##At,,## 
B
lGhJd. . ## 
r|  z*raw_ops.LoadTPUEmbeddingAdadeltaParametersc
           
      .   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| ||g}
d|d|d|d|d|f
}t        j                  dd	|
||	|
      }d }|S )Nrs  rt  r   ru  r   rv  r   s"   LoadTPUEmbeddingAdadeltaParametersr   rT   r~  )rp  r  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                rP   r  r  .	  s     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*''gooF,""7GOO<'lG4,,
Lj(Hf6&BA$0C"&(' '	.rn   c	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load Adagrad Momentum embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the Adagrad Momentum optimization algorithm.
    accumulators: A `Tensor` of type `float32`.
      Value of accumulators used in the Adagrad Momentum optimization algorithm.
    momenta: A `Tensor` of type `float32`.
      Value of momenta used in the Adagrad Momentum optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  )LoadTPUEmbeddingAdagradMomentumParametersru  rv  rs  rt  r   Nry  r   r   )	rp  r  rq  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   =load_tpu_embedding_adagrad_momentum_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  rq  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                   rP   .load_tpu_embedding_adagrad_momentum_parametersr  G	  s   4 
			0h..0$#\\	1194gz8\:j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'883
BN=D@J>F>F@J<BO!QX 
*A && -
##At,,## 
J
lGhJd. . ## 
r|  z1raw_ops.LoadTPUEmbeddingAdagradMomentumParametersc
           
      .   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| ||g}
d|d|d|d|d|f
}t        j                  dd	|
||	|
      }d }|S )Nrs  rt  r   ru  r   rv  r   s)   LoadTPUEmbeddingAdagradMomentumParametersr   rT   r~  )rp  r  rq  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                rP   r  r  	  s     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*''gooF,""7GOO<'lG4,,
Lj(Hf6&I1$0C"&(' '	.rn   c                    t         j                   xs t        j                         }|j                  }	|	j                  r&	 t	        j
                  |d|| |d|d|d|d|d|      }
|
S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)aq  Load Adagrad embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the Adagrad optimization algorithm.
    accumulators: A `Tensor` of type `float32`.
      Value of accumulators used in the Adagrad optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  !LoadTPUEmbeddingAdagradParametersru  rv  rs  rt  r   Nry  r   r   rp  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   4load_tpu_embedding_adagrad_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rp  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                  rP   %load_tpu_embedding_adagrad_parametersr  	  s   0 
			0h..0$#\\	1114j(L*j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'88+
:F8B6>6>8B4:G!QX 
*? && -
##At,,## 
A
lX*(6  ## 
0    $D ED22E
EE# #E:9E:z)raw_ops.LoadTPUEmbeddingAdagradParametersc	           
         t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }| |g}	d|d|d|d|d|f
}
t        j                  dd	|	|
||
      }d }|S )Nrs  rt  r   ru  r   rv  r   s!   LoadTPUEmbeddingAdagradParametersr   rT   r~  rp  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s               rP   r  r  	  s      \:*x4(Hx4(J  \:*^FVX.&%%j'//B*''gooF,l+,,
Lj(Hf6&A1$0C"&(' '	.rn   msmommgc
                    t         j                   xs t        j                         }
|
j                  }|j                  r(	 t	        j
                  |
d|	| |||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)aT  Load centered RMSProp embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the centered RMSProp optimization algorithm.
    ms: A `Tensor` of type `float32`.
      Value of ms used in the centered RMSProp optimization algorithm.
    mom: A `Tensor` of type `float32`.
      Value of mom used in the centered RMSProp optimization algorithm.
    mg: A `Tensor` of type `float32`.
      Value of mg used in the centered RMSProp optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  )LoadTPUEmbeddingCenteredRMSPropParametersru  rv  rs  rt  r   Nry  r   r   )
rp  r  r  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   >load_tpu_embedding_centered_rms_prop_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  r  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                    rP   /load_tpu_embedding_centered_rms_prop_parametersr  
  s   8 
			0h..0$#\\	1194
CZ<j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'883
8:@J>F>F@J<BO!QX 
*? && -
##At,,## 
K
b#rH(6  ## 
0    &D ED66EEE) )F ?F z1raw_ops.LoadTPUEmbeddingCenteredRMSPropParametersc           
      x   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }| |||g}d|d|d|d|d|f
}t        j                  dd	|||
|	
      }d }|S )Nrs  rt  r   ru  r   rv  r   s)   LoadTPUEmbeddingCenteredRMSPropParametersr   rT   r~  )rp  r  r  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                 rP   r  r  K
  s*     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*b'//2"sGOO4#b'//2"b#r*,,
Lj(Hf6&I1$0C"&(' '	.rn   linearsc	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load FTRL embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the FTRL optimization algorithm.
    accumulators: A `Tensor` of type `float32`.
      Value of accumulators used in the FTRL optimization algorithm.
    linears: A `Tensor` of type `float32`.
      Value of linears used in the FTRL optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  LoadTPUEmbeddingFTRLParametersru  rv  rs  rt  r   Nry  r   r   )	rp  r  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   1load_tpu_embedding_ftrl_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                   rP   "load_tpu_embedding_ftrl_parametersr  e
  s   4 
			0h..0$#\\	11.jgz8\:j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'88(Z7C295?3;3;5?17dD!QX 
*A && -
##At,,## 
>
lGhJd. . ## 
r|  z&raw_ops.LoadTPUEmbeddingFTRLParametersc
           
      .   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| ||g}
d|d|d|d|d|f
}t        j                  dd	|
||	|
      }d }|S )Nrs  rt  r   ru  r   rv  r   s   LoadTPUEmbeddingFTRLParametersr   rT   r~  )rp  r  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                rP   r  r  
  s     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*''gooF,""7GOO<'lG4,,
Lj(Hf6&>$0C"&(' '	.rn   last_hit_stepc                    t         j                   xs t        j                         }|j                  }	|	j                  r&	 t	        j
                  |d|| |d|d|d|d|d|      }
|
S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load frequency estimator embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the frequency estimator optimization algorithm.
    last_hit_step: A `Tensor` of type `float32`.
      Value of last_hit_step used in the frequency estimator optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  ,LoadTPUEmbeddingFrequencyEstimatorParametersru  rv  rs  rt  r   Nry  r   r   )rp  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   @load_tpu_embedding_frequency_estimator_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                  rP   1load_tpu_embedding_frequency_estimator_parametersr  
  s   0 
			0h..0$#\\
11<dM:xL*j(H	g
 n   \:*x4(Hx4(J  \:*^FVX.&'886:FSCMAIAICM?E=AC!QX 
*A && -
##At,,## 
M
mh:(6  ## 
r  z4raw_ops.LoadTPUEmbeddingFrequencyEstimatorParametersc	           
         t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }| |g}	d|d|d|d|d|f
}
t        j                  dd	|	|
||
      }d }|S )Nrs  rt  r   ru  r   rv  r   s,   LoadTPUEmbeddingFrequencyEstimatorParametersr   rT   r~  )rp  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s               rP   r  r    s      \:*x4(Hx4(J  \:*^FVX.&%%j'//B*((H-m,,,
Lj(Hf6&L|6s"&(' '	.rn   weightsbenefitsc
                    t         j                   xs t        j                         }
|
j                  }|j                  r(	 t	        j
                  |
d|	| |||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load MDL Adagrad Light embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the MDL Adagrad Light optimization algorithm.
    accumulators: A `Tensor` of type `float32`.
      Value of accumulators used in the MDL Adagrad Light optimization algorithm.
    weights: A `Tensor` of type `float32`.
      Value of weights used in the MDL Adagrad Light optimization algorithm.
    benefits: A `Tensor` of type `float32`.
      Value of benefits used in the MDL Adagrad Light optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  )LoadTPUEmbeddingMDLAdagradLightParametersru  rv  rs  rt  r   Nry  r   r   )
rp  r  r  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   >load_tpu_embedding_mdl_adagrad_light_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  r  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                    rP   /load_tpu_embedding_mdl_adagrad_light_parametersr  #  s   8 
			0h..0$#\\
1194gxX|L*j(H	g
 n   \:*x4(Hx4(J  \:*^FVX.&'883
BN=D>F@J>F>F@J<B	O!QX 
*C && -
##At,,## 
K
lGXJd. . ## 
r  z1raw_ops.LoadTPUEmbeddingMDLAdagradLightParametersc           
      x   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }t        j                  |t
        j                        }| |||g}d|d|d|d|d|f
}t        j                  dd	|||
|	
      }d }|S )Nrs  rt  r   ru  r   rv  r   s)   LoadTPUEmbeddingMDLAdagradLightParametersr   rT   r~  )rp  r  r  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                 rP   r  r  n  s*     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*''gooF,""7GOO<'##Hgoo>(lGX>,,
Lj(Hf6&I1$0C"&(' '	.rn   c                    t         j                   xs t        j                         }|j                  }	|	j                  r&	 t	        j
                  |d|| |d|d|d|d|d|      }
|
S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)aj  Load Momentum embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the Momentum optimization algorithm.
    momenta: A `Tensor` of type `float32`.
      Value of momenta used in the Momentum optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  "LoadTPUEmbeddingMomentumParametersru  rv  rs  rt  r   Nry  r   r   )rp  rq  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   5load_tpu_embedding_momentum_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  rq  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                  rP   &load_tpu_embedding_momentum_parametersr    s   0 
			0h..0$#\\	112D*gHlJJ(F<g n   \:*x4(Hx4(J  \:*^FVX.&'88,6=9C7?7?9C5;$H!QX 
*? && -
##At,,## 
B
gZ(6  ## 
r  z*raw_ops.LoadTPUEmbeddingMomentumParametersc	           
         t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }| |g}	d|d|d|d|d|f
}
t        j                  dd	|	|
||
      }d }|S )Nrs  rt  r   ru  r   rv  r   s"   LoadTPUEmbeddingMomentumParametersr   rT   r~  )rp  rq  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s               rP   r  r    s      \:*x4(Hx4(J  \:*^FVX.&%%j'//B*""7GOO<'g&,,
Lj(Hf6&BA$0C"&(' '	.rn   c                    t         j                   xs t        j                         }|j                  }	|	j                  r&	 t	        j
                  |d|| |d|d|d|d|d|      }
|
S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load proximal Adagrad embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the proximal Adagrad optimization algorithm.
    accumulators: A `Tensor` of type `float32`.
      Value of accumulators used in the proximal Adagrad optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  )LoadTPUEmbeddingProximalAdagradParametersru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   =load_tpu_embedding_proximal_adagrad_parameters_eager_fallbackr=   r>   r?   r   r@   rA   r  s                  rP   .load_tpu_embedding_proximal_adagrad_parametersr    s   0 
			0h..0$#\\	1194j(L*j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'883
BN@J>F>F@J<BO!QX 
*? && -
##At,,## 
J
lX*(6  ## 
r  z1raw_ops.LoadTPUEmbeddingProximalAdagradParametersc	           
         t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }| |g}	d|d|d|d|d|f
}
t        j                  dd	|	|
||
      }d }|S )Nrs  rt  r   ru  r   rv  r   s)   LoadTPUEmbeddingProximalAdagradParametersr   rT   r~  r  s               rP   r  r  (  s      \:*x4(Hx4(J  \:*^FVX.&%%j'//B*''gooF,l+,,
Lj(Hf6&I1$0C"&(' '	.rn   vmc	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  TODO: add doc.

  Args:
    parameters: A `Tensor` of type `float32`.
    v: A `Tensor` of type `float32`.
    m: A `Tensor` of type `float32`.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  &LoadTPUEmbeddingProximalYogiParametersru  rv  rs  rt  r   Nry  r   r   )	rp  r  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   :load_tpu_embedding_proximal_yogi_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                   rP   +load_tpu_embedding_proximal_yogi_parametersr  @  s   " 
			0h..0$#\\	116j!	:xz<J(F<g n   \:*x4(Hx4(J  \:*^FVX.&'880Z145*;C;C=G9?dL!QX 
*= && -
##At,,## 
G
aX*(6  ## 
r|  z.raw_ops.LoadTPUEmbeddingProximalYogiParametersc
           
      .   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| ||g}
d|d|d|d|d|f
}t        j                  dd	|
||	|
      }d }|S )Nrs  rt  r   ru  r   rv  r   s&   LoadTPUEmbeddingProximalYogiParametersr   rT   r~  )rp  r  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                rP   r  r  |  s     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*
Q0!
Q0!a#,,
Lj(Hf6&F$0C"&(' '	.rn   c	                     t         j                   xs t        j                         }	|	j                  }
|
j                  r'	 t	        j
                  |	d|| ||d|d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a  Load RMSProp embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the RMSProp optimization algorithm.
    ms: A `Tensor` of type `float32`.
      Value of ms used in the RMSProp optimization algorithm.
    mom: A `Tensor` of type `float32`.
      Value of mom used in the RMSProp optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  !LoadTPUEmbeddingRMSPropParametersru  rv  rs  rt  r   Nry  r   r   )	rp  r  r  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   5load_tpu_embedding_rms_prop_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  r  r  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                   rP   &load_tpu_embedding_rms_prop_parametersr    s   4 
			0h..0$#\\	1114RHlJJ(F<g n   \:*x4(Hx4(J  \:*^FVX.&'88+
r146>6>8B4:G!QX 
*= && -
##At,,## 
B
b#Z(6  ## 
r|  z)raw_ops.LoadTPUEmbeddingRMSPropParametersc
           
      .   t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| ||g}
d|d|d|d|d|f
}t        j                  dd	|
||	|
      }d }|S )Nrs  rt  r   ru  r   rv  r   s!   LoadTPUEmbeddingRMSPropParametersr   rT   r~  )rp  r  r  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s                rP   r  r    s     \:*x4(Hx4(J  \:*^FVX.&%%j'//B*b'//2"sGOO4#b#&,,
Lj(Hf6&A1$0C"&(' '	.rn   c                    t         j                   xs t        j                         }|j                  }|j                  r%	 t	        j
                  |d|| d|d|d|d|d|      }	|	S t        j                  |d      }t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  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)a	  Load SGD embedding parameters.

  An op that loads optimization parameters into HBM for embedding. Must be
  preceded by a ConfigureTPUEmbeddingHost op that sets up the correct
  embedding table configuration. For example, this op is used to install
  parameters that are loaded from a checkpoint before a training loop is
  executed.

  Args:
    parameters: A `Tensor` of type `float32`.
      Value of parameters used in the stochastic gradient descent optimization algorithm.
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  3LoadTPUEmbeddingStochasticGradientDescentParametersru  rv  rs  rt  r   Nry  r   r   )rp  rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   Hload_tpu_embedding_stochastic_gradient_descent_parameters_eager_fallbackr=   r>   r?   r   r@   rA   )rp  rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   s                 rP   9load_tpu_embedding_stochastic_gradient_descent_parametersr    s   , 
			0h..0$#\\	11CTJ,
j*h&Jg n   \:*x4(Hx4(J  \:*^FVX.&'88=*JTHPHPJTFLDHJ!QX 
*? && -
##At,,## 
U
xJ(6  ## 
s0    #D E	D00E	E	E   E76E7z;raw_ops.LoadTPUEmbeddingStochasticGradientDescentParametersc           
         t        j                  |d      }t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } | g}d|d|d|d|d|f
}	t        j                  dd	||	||
      }
d }
|
S )Nrs  rt  r   ru  r   rv  r   s3   LoadTPUEmbeddingStochasticGradientDescentParametersr   rT   r~  )rp  rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s              rP   r  r  5  s      \:*x4(Hx4(J  \:*^FVX.&%%j'//B*,,
Lj(Hf6&S|6s"&(' '	.rn   ) TV_OutfeedDequeue_dtyper   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c                 b   t         j                   xs t        j                         }|j                  }|j                  r 	 t	        j
                  |d|d| d|d|	      }|S t        j                  | d      } t        j                  |d      }|d}t        j                   |d      }t#        j$                  d| |||      \  }}}	}
|
dd }t        j&                         rYd|	j)                  d      d|	j+                  d      d|	j-                  d      f}|	j.                  }t        j0                  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 Nw xY w)	a7  Retrieves a single tensor from the computation outfeed.

  This operation will block indefinitely until data is available.

  Args:
    dtype: A `tf.DType`. The type of elements in the tensor.
    shape: A `tf.TensorShape` or list of `ints`. The shape of the tensor.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. This should be -1 when the Op
      is running on a TPU device, and >= 0 when the Op is running on the CPU
      device.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  OutfeedDequeuer=  r@  r   N)r=  r@  r   r0   r1   r   )r=  r@  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   outfeed_dequeue_eager_fallbackr=   r>   rC  rD  r?   r@   rA   rB   rC   r   rD   rE   rF   )r=  r@  r   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s                rP   outfeed_dequeuer  N  s   " 
			0h..0$#\\11gugu.*g n 

UG
,%


eW
-%N$$^5EF.'88U)7dD!QX QK'""$s))'2Gll7#%5 013F ::L,9('	.9 && -
##At,,## 
+U>  ## 
s0    D< <FE**FFF F.-F.zraw_ops.OutfeedDequeuec                 <   t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }g }d| d|d|f}t        j                  dd||||      }t        j
                         rt        j                  d|||       |\  }|S )	Nr=  r@  r   r   s   OutfeedDequeuerS   rT   r  )r>   rC  rD  r?   r   rB   rF   )r=  r@  r   r0   r1   rO   rN   rI   s           rP   r  r    s    


UG
,%


eW
-%N$$^5EF.,UGU,<nM&.,#)s?'""$,9('	.rn   c                 :   t         j                   xs t        j                         }|j                  }|j                  r 	 t	        j
                  |d|d| d|d|	      }|S t        | t        t        f      st!        d| z        | D cg c]  }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.                         rYd|j1                  d      d|j1                  d      d|j3                  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 c c}	w )a  Retrieve multiple values from the computation outfeed.

  This operation will block indefinitely until data is available. Output `i`
  corresponds to XLA tuple element `i`.

  Args:
    dtypes: A list of `tf.DTypes` that has length `>= 1`.
      The element types of each element in `outputs`.
    shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`).
      The shapes of each tensor in `outputs`.
    device_ordinal: An optional `int`. Defaults to `-1`.
      The TPU device to use. This should be -1 when the Op
      is running on a TPU device, and >= 0 when the Op is running on the CPU
      device.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `dtypes`.
  OutfeedDequeueTupler   rJ  r   N)r   rJ  r   r0   r1   JExpected list for 'dtypes' argument to 'outfeed_dequeue_tuple' Op, not %r.JExpected list for 'shapes' argument to 'outfeed_dequeue_tuple' Op, not %r.r   )r   rJ  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   $outfeed_dequeue_tuple_eager_fallbackr=   r   r   r   r   r>   rC  rD  r?   r@   rA   rB   r   rD   rE   rF   )r   rJ  r   r0   rG   rH   rI   rJ   rO  r   rK   rL   rM   rN   rO   s                  rP   outfeed_dequeue_tupler    s4   ( 
			0h..0$#\\11#T8VXv.*g n 
FT5M	*
	.06	78 8 8>>Hr8,>&>	FT5M	*
	.06	78 8 9??"HH-?&?N$$^5EF.'88fV.<4I!QX QK'	J""$X.ll8$&6 013F ::L|VW>	.K && -
##At,,## 
1~  ## 
 ?
 @s<    F HHG%1GG%$G%)G9 9HHzraw_ops.OutfeedDequeueTuplec                    t        | t        t        f      st        d| z        | D cg c]  }t	        j
                  |d       } }t        |t        t        f      st        d|z        |D cg c]  }t	        j                  |d       }}|d}t	        j                  |d      }g }d| d|d|f}t	        j                  dt        |       ||||      }	t	        j                         rt	        j                  d	|||	       |	S c c}w c c}w )
Nr  r   r  rJ  r   r   s   OutfeedDequeueTuplerT   r  )r   r   r   r   r>   rC  rD  r?   r   r   rB   rF   )
r   rJ  r   r0   r1   rO  r   rO   rN   rI   s
             rP   r  r    s'   	FT5M	*
	.06	78 8 8>>Hr8,>&>	FT5M	*
	.06	78 8 9??"HH-?&?N$$^5EF.,fh0@&3S[$0C"&(' ""$|VW>	.% ?
 @s   D0D
c           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S t        |t        t        f      st!        d|z        |D cg c]  }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,                         rHd|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 w xY wc c}w c c}	w )	a*  Retrieve multiple values from the computation outfeed. Device ordinal is a
tensor allowing dynamic outfeed.

  This operation will block indefinitely until data is available. Output `i`
  corresponds to XLA tuple element `i`.

  Args:
    device_ordinal: A `Tensor` of type `int32`.
      An int scalar tensor, representing the TPU device to use. This should be -1 when
      the Op is running on a TPU device, and >= 0 when the Op is running on the CPU
      device.
    dtypes: A list of `tf.DTypes` that has length `>= 1`.
      The element types of each element in `outputs`.
    shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`).
      The shapes of each tensor in `outputs`.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `dtypes`.
  OutfeedDequeueTupleV2r   rJ  NrK  MExpected list for 'dtypes' argument to 'outfeed_dequeue_tuple_v2' Op, not %r.MExpected list for 'shapes' argument to 'outfeed_dequeue_tuple_v2' Op, not %r.)r   r   rJ  r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   'outfeed_dequeue_tuple_v2_eager_fallbackr=   r   r   r   r   r>   rC  rD  r@   rA   rB   r   rE   rF   )r   r   rJ  r0   rG   rH   rI   rJ   rO  r   rK   rL   rM   rN   rO   s                  rP   outfeed_dequeue_tuple_v2r    s   * 
			0h..0$#\\11%t^Xv&g n 
FT5M	*
	139	:; ; 8>>Hr8,>&>	FT5M	*
	139	:; ; 9??"HH-?&?'88v(.T;!QX QK'	J""$X.ll8$&F::Lvw@	.A && -
##At,,## 
4
TtM M## 
 ?
 @s<    E2 G'G,2F9F  F98F9=G G$#G$zraw_ops.OutfeedDequeueTupleV2c                 0   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}t        |t        t        f      st        d|z        |D cg c]  }t	        j                  |d       }}t        j                  | t        j                        } | g}d|d|f}t	        j                  dt        |      ||||      }	t	        j                         rt	        j                  d|||	       |	S c c}w c c}w )Nr  r   r  rJ  s   OutfeedDequeueTupleV2rT   r  )r   r   r   r   r>   rC  rD  r9   rl   rW   rZ   r   r   rB   rF   )
r   r   rJ  r0   r1   rO  r   rO   rN   rI   s
             rP   r  r  ;  s   	FT5M	*
	139	:; ; 8>>Hr8,>&>	FT5M	*
	139	:; ; 9??"HH-?&?)).'--H. !,fh/&5s6{$0C"&(' ""$vw@	. ?
 @s   D0D) TV_OutfeedDequeueV2_dtyper   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c           
      
   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S t        j                  |d      }t        j                  |d      }t!        j"                  d| |||      \  }}}	}
|
dd }t        j$                         rHd|	j'                  d      d|	j)                  d      f}|	j*                  }t        j,                  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)a  Retrieves a single tensor from the computation outfeed. Device ordinal is a
tensor allowing dynamic outfeed.

  This operation will block indefinitely until data is available.

  Args:
    device_ordinal: A `Tensor` of type `int32`.
      An int scalar tensor, representing the TPU device to use. This should be -1 when
      the Op is running on a TPU device, and >= 0 when the Op is running on the CPU
      device.
    dtype: A `tf.DType`. The type of elements in the tensor.
    shape: A `tf.TensorShape` or list of `ints`. The shape of the tensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  OutfeedDequeueV2r=  r@  NrA  )r   r=  r@  r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   !outfeed_dequeue_v2_eager_fallbackr=   r>   rC  rD  r@   rA   rB   rC   r   rE   rF   )r   r=  r@  r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s                rP   outfeed_dequeue_v2r  T  s   $ 
			0h..0$#\\11 $g n 

UG
,%


eW
-%'88>"'d4!QX QK'""$s))'2Gll7#%F::LL&';('	./ && -
##At,,## 
.
U4I I## 
s0    D E#D>>EEE+ +FFzraw_ops.OutfeedDequeueV2c                 N   t        j                  |d      }t        j                  |d      }t        j                  | t
        j                        } | g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr=  r@  s   OutfeedDequeueV2rS   rT   r  )
r>   rC  rD  r9   rl   rW   rZ   r   rB   rF   )r   r=  r@  r0   r1   rO   rN   rI   s           rP   r  r    s    


UG
,%


eW
-%)).'--H. !,UGU+&0!L#)s?'""$L&';('	.rn   ) TV_OutfeedEnqueue_dtyper   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  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)zEnqueue a Tensor on the computation outfeed.

  Args:
    input: A `Tensor`. A tensor that will be inserted into the outfeed queue.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  OutfeedEnqueueNr   )r(   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   outfeed_enqueue_eager_fallbackr=   r@   rA   )	r(   r0   rG   rH   rI   rJ   rK   rL   rM   s	            rP   outfeed_enqueuer    s     
			0h..0$#\\11e-gn (88D2!QX	* && -
##At,,## 
+
d& &## 
0    A9 9C B''C ?C C C('C(zraw_ops.OutfeedEnqueuec                     t        j                  | g|g       \  }\  } | g}d|f}t        j                  dd||||      }d }|S )Nr=  s   OutfeedEnqueuer   rT   )r>   rV   r   )r(   r0   r1   rZ  rO   rN   rI   s          rP   r  r    sX    "995'3K+x,[!&.,#)s?''	.rn   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  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)a   Enqueue multiple Tensor values on the computation outfeed.

  Args:
    inputs: A list of `Tensor` objects.
      A list of tensors that will be inserted into the outfeed queue as an
      XLA tuple.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  OutfeedEnqueueTupleNr   )rE   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   $outfeed_enqueue_tuple_eager_fallbackr=   r@   rA   )	rE   r0   rG   rH   rI   rJ   rK   rL   rM   s	            rP   outfeed_enqueue_tupler    s     
			0h..0$#\\11#T63gn (88f49!QX	* && -
##At,,## 
1
t' '## 
r  zraw_ops.OutfeedEnqueueTuplec                     t        j                  | |      \  }} t        |       }d|f}t        j                  dd||||      }d }|S )Nr   s   OutfeedEnqueueTupler   rT   )r>   ri  r   r   )rE   r0   r1   rj  rO   rN   rI   s          rP   r  r    sT    !@@M,f,l#&3Q|#)s?''	.rn   ) TV_Prelinearize_dtyper   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S |g }t        j                  |d      }|g }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|
j1                  d      d|
j1                  d      f}|
j2                  }t        j4                  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 mw xY wc c}w )	aO  An op which linearizes one Tensor value to an opaque variant tensor.

  Args:
    input: A `Tensor`. A tensor that will be linearized.
    shape: An optional `tf.TensorShape` or list of `ints`. Defaults to `[]`.
      The shape of the tensor.
    layout: An optional list of `ints`. Defaults to `[]`.
      A vector holding the requested layout in minor-to-major sequence. If a layout
      attribute is passed but its values are all -1 the layout will be computed by
      the infeed operation.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `variant`.
  Prelinearizer@  rU  N)r@  rU  r0   r1   AExpected list for 'layout' argument to 'prelinearize' Op, not %r.)r(   r@  rU  r0   r=  )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   prelinearize_eager_fallbackr=   r>   rD  r   r   r   r   r?   r@   rA   rB   rC   r   rE   rF   )r(   r@  rU  r0   rG   rH   rI   rJ   r   rK   rL   rM   rN   rO   s                 rP   prelinearizer    s     
			0h..0$#\\11ndE7E8VMgn ]E


eW
-%^F	FT5M	*
	%'-	./ / 7==Hb(+=&='88e5dL!QXQK'""$s))'2Gll7#Xs||H/EGF::Lfg7('	.= && -
##At,,## 
(
uV$DB B## 
 >s6    E $GF!-FF! F!%F5 5GGzraw_ops.Prelinearizec                    |g }t        j                  |d      }|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  | g|g       \  }\  } | g}d|d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S c c}w )	Nr@  r  rU  r=  s   PrelinearizerS   rT   r  )r>   rD  r   r   r   r   r?   rV   r   rB   rF   )
r(   r@  rU  r0   r1   r   rZ  rO   rN   rI   s
             rP   r  r  /  s    
]E


eW
-%^F	FT5M	*
	%'-	./ / 7==Hb(+=&="995'3K+x,['5(FC&_a#)s?'""$fg7('	. >s   Cc           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S t        |t        t        f      st!        d|z        |D cg c]  }t#        j$                  |d       }}|g }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 w xY wc c}w c c}	w )
a  An op which linearizes multiple Tensor values to an opaque variant tensor.

  Args:
    inputs: A list of `Tensor` objects.
      A list of tensors that will be provided using the infeed mechanism.
    shapes: A list of shapes (each a `tf.TensorShape` or list of `ints`).
      The shapes of each tensor in `inputs`.
    layouts: An optional list of `ints`. Defaults to `[]`.
      A vector holding the requested layout in minor-to-major sequence for all the
      tuple shapes in the order the shapes appear in the "shapes" input. The layout
      elements for a sub-shape can be set to -1 in which case the corresponding layout
      will be computed by the infeed operation.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `variant`.
  PrelinearizeTuplerJ  rc  N)rJ  rc  r0   r1   GExpected list for 'shapes' argument to 'prelinearize_tuple' Op, not %r.HExpected list for 'layouts' argument to 'prelinearize_tuple' Op, not %r.)rE   rJ  rc  r0   r   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   !prelinearize_tuple_eager_fallbackr=   r   r   r   r   r>   rD  r?   r@   rA   rB   r   rE   rF   )rE   rJ  rc  r0   rG   rH   rI   rJ   r   r   rK   rL   rM   rN   rO   s                  rP   prelinearize_tupler  F  s   $ 
			0h..0$#\\11!469g n 
FT5M	*
	+-3	45 5 9??"HH-?&?_G	GdE]	+
	+-4	56 6 9@@"Xr9-@'@'88F67"&(!QX QK'""$X.ll8$ii1HJF::L\67<('	.C && -
##At,,## 
.
tG G## 
 @ As<    F G<HGF55GGG" "G98G9zraw_ops.PrelinearizeTuplec                 ,   t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|g }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d||	||      }
t	        j                         rt	        j                  d	||	|
       |
\  }
|
S c c}w c c}w )
Nr  rJ  r  rc  r   s   PrelinearizeTuplerS   rT   r  )r   r   r   r   r>   rD  r?   ri  r   rB   rF   )rE   rJ  rc  r0   r1   r   r   rj  rO   rN   rI   s              rP   r  r    s,   	FT5M	*
	+-3	45 5 9??"HH-?&?_G	GdE]	+
	+-4	56 6 9@@"Xr9-@'@!@@M,f,lHfiI&11\#)s?'""$\67<('	.# @ As   D4D) TV_ReadVariableXlaSplitND_Tr   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   r2   r   c                    t         j                   xs t        j                         }|j                  }|j                  r#	 t	        j
                  |d|| d|d|d|d|      }|S t        j                  |d      }t        j                  |d      }t!        |t"        t$        f      st'        d|z        |D 
cg c]  }
t        j                  |
d       }}
|g }t!        |t"        t$        f      st'        d	|z        |D 
cg c]  }
t        j                  |
d       }}
t)        j*                  d| |||||
      \  }}}}|dd }|s|S t        j,                         rjd|j/                  d      d|j1                  d      d|j3                  d      d|j3                  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 c c}
w )a  Splits resource variable input tensor across all dimensions.

  An op which splits the resource variable input tensor based on the given
  num_splits attribute, pads slices optionally, and returned the slices. Slices
  are returned in row-major order.

  This op may be generated via the TPU bridge.

  For example, with `input` tensor:
  ```
  [[0, 1, 2],
   [3, 4, 5],
   [6, 7, 8]]
  ```
  `num_splits`:
  ```
  [2, 2]
  ```
  and `paddings`:
  ```
  [1, 1]
  ```
  the expected `outputs` is:
  ```
  [[0, 1],
   [3, 4]]
  [[2, 0],
   [5, 0]]
  [[6, 7],
   [0, 0]]
  [[8, 0],
   [0, 0]]
  ```

  Args:
    resource: A `Tensor` of type `resource`.
      Resource variable of input tensor to split across all dimensions.
    T: A `tf.DType`.
    N: An `int` that is `>= 1`.
    num_splits: A list of `ints`.
      Number of ways to split per dimension. Shape dimensions must be evenly
      divisible.
    paddings: An optional list of `ints`. Defaults to `[]`.
      Optional list of right paddings per dimension of input tensor to apply before
      splitting. This can be used to make a dimension evenly divisible.
    name: A name for the operation (optional).

  Returns:
    A list of `N` `Tensor` objects with type `T`.
  ReadVariableXlaSplitNDr2   r   
num_splitsr   N)r2   r   r  r   r0   r1   SExpected list for 'num_splits' argument to 'read_variable_xla_split_nd' Op, not %r.QExpected list for 'paddings' argument to 'read_variable_xla_split_nd' Op, not %r.)r{   r2   r   r  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   )read_variable_xla_split_nd_eager_fallbackr=   r>   rC  r?   r   r   r   r   r@   rA   rB   rC   rD   r   rE   rF   )r{   r2   r   r  r   r0   rG   rH   rI   rJ   r   rK   rL   rM   rN   rO   s                   rP   read_variable_xla_split_ndr    sh   f 
			0h..0$#\\11&hQQj*h8g n C !3!	Ju	.
	35?	@A A ?II!!"l3I*IH	HtUm	,
	35=	>? ? ;CCBhJ/C(C'88 8qA-7('+-!QX QK'	J""$3%%c*C1B1B31GCLL6
ll:&(F ::L ,A	.O && -
##At,,## 
6
a1h  ## 
 J Ds<    !G
 6II
HG88HHH' 'H>=H>zraw_ops.ReadVariableXlaSplitNDc                    t        j                  |d      }t        j                  |d      }t        |t        t
        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t
        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  | t        j                        } | g}d|d|d|d|f}	t        j                  d|||	||      }
t        j                         rt        j                  d	||	|
       |
S c c}w c c}w )
Nr2   r   r  r  r  r   s   ReadVariableXlaSplitNDrT   r  )r>   rC  r?   r   r   r   r   r9   rl   rW   r{   r   rB   rF   )r{   r2   r   r  r   r0   r1   r   rO   rN   rI   s              rP   r  r    sU   C !3!	Ju	.
	35?	@A A ?II!!"l3I*IH	HtUm	,
	35=	>? ? ;CCBhJ/C(C##Hg.>.>?(,CL*j(K&6$0C"&(' ""$ ,A	.# J Ds   D9 D>num_outputsc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|d| d|      }|S t        j                  | d      } t        j                  |d      }t!        j"                  d| ||      \  }}}}	|	dd }|s|S t        j$                         rHd|j'                  d      d|j)                  d      f}
|j*                  }t        j,                  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)aZ  An op that receives embedding activations on the TPU.

  The TPU system performs the embedding lookups and aggregations specified by
  the arguments to TPUEmbeddingEnqueue(Integer/Sparse/SparseTensor)Batch. The
  results of these aggregations are visible to the Tensorflow Graph as the
  outputs of a RecvTPUEmbeddingActivations op. This op returns a list containing
  one Tensor of activations per table specified in the model. There can be at
  most one RecvTPUEmbeddingActivations op in the TPU graph.

  Args:
    num_outputs: An `int` that is `>= 1`.
      The number of output activation tensors, equal to the number of
      embedding tables in the model.
    config: A `string`. Serialized TPUEmbeddingConfiguration proto.
    name: A name for the operation (optional).

  Returns:
    A list of `num_outputs` `Tensor` objects with type `float32`.
  RecvTPUEmbeddingActivationsr  r   N)r  r   r0   r1   )r  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   -recv_tpu_embedding_activations_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   )r  r   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s               rP   recv_tpu_embedding_activationsr  #  s   ( 
			0h..0$#\\11+T=+&g n !!+}=+VX.&'88%;v,02!QX QK'	J""$S..}=xll8$&F::L%|VWF	.1 && -
##At,,## 
:!&tG G## 
rF  z#raw_ops.RecvTPUEmbeddingActivationsc                     t        j                  | d      } t        j                  |d      }g }d| d|f}t        j                  d| ||||      }t        j                         rt        j
                  d|||       |S )Nr  r   s   RecvTPUEmbeddingActivationsrT   r
  r>   r?   r   r   rB   rF   )r  r   r0   r1   rO   rN   rI   s          rP   r  r  \  s    !!+}=+VX.&,;&9&;[$0C"&(' ""$%|VWF	.rn   "RetrieveTPUEmbeddingADAMParameters)rp  rq  rr  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a  Retrieve ADAM embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, momenta, velocities).

    parameters: A `Tensor` of type `float32`.
    momenta: A `Tensor` of type `float32`.
    velocities: A `Tensor` of type `float32`.
  r  ru  rv  rs  rt  r   Nry  r   r   rs  rt  ru  rv  r   r0   )r3   r   r4   r5   r   r6   )_RetrieveTPUEmbeddingADAMParametersOutput_maker7   r8   r9   r:   r;   5retrieve_tpu_embedding_adam_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   rs  rt  ru  rv  r   r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s                  rP   &retrieve_tpu_embedding_adam_parametersr  n  ?   . 
			0h..0$#\\
112D*,
L*Hh0g :??Hgn   \:*x4(Hx4(J  \:*^FVX.&'88,7?7?9C5;$H!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L,lFGM5;;GD'	.M && -
##At,,## 
B
zF4A A ## 
0    7F> >HG,,HH	H H21H2z*raw_ops.RetrieveTPUEmbeddingADAMParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s"   RetrieveTPUEmbeddingADAMParameters   rT   r  )r>   r?   r   r   rB   rF   r  r  
rs  rt  ru  rv  r   r0   r1   rO   rN   rI   s
             rP   r  r          \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&BA$0C"&(' ""$,lFGM5;;GD'	.rn   &RetrieveTPUEmbeddingAdadeltaParameters)rp  r  r  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a&  Retrieve Adadelta embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, accumulators, updates).

    parameters: A `Tensor` of type `float32`.
    accumulators: A `Tensor` of type `float32`.
    updates: A `Tensor` of type `float32`.
  r  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   -_RetrieveTPUEmbeddingAdadeltaParametersOutputr  r7   r8   r9   r:   r;   9retrieve_tpu_embedding_adadelta_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   *retrieve_tpu_embedding_adadelta_parametersr!    s?   . 
			0h..0$#\\
116j,
L*Hh0g >CCGLgn   \:*x4(Hx4(J  \:*^FVX.&'880Z;C;C=G9?dL!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L0,Q9??H'	.M && -
##At,,## 
F
zF4A A ## 
r  z.raw_ops.RetrieveTPUEmbeddingAdadeltaParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s&   RetrieveTPUEmbeddingAdadeltaParametersr  rT   r  )r>   r?   r   r   rB   rF   r  r  r  s
             rP   r   r   #        \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&F$0C"&(' ""$0,Q9??H'	.rn   -RetrieveTPUEmbeddingAdagradMomentumParameters)rp  r  rq  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a.  Retrieve Adagrad Momentum embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, accumulators, momenta).

    parameters: A `Tensor` of type `float32`.
    accumulators: A `Tensor` of type `float32`.
    momenta: A `Tensor` of type `float32`.
  r$  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   4_RetrieveTPUEmbeddingAdagradMomentumParametersOutputr  r7   r8   r9   r:   r;   Aretrieve_tpu_embedding_adagrad_momentum_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   2retrieve_tpu_embedding_adagrad_momentum_parametersr(  @  sA   . 
			0h..0$#\\
11=tHlJJ(F<g EJJ7Sgn   \:*x4(Hx4(J  \:*^FVX.&'887JBJBJDN@F>BD!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L7vwX@FFwO'	.O && -
##At,,## 
N
zF4A A ## 
r  z5raw_ops.RetrieveTPUEmbeddingAdagradMomentumParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s-   RetrieveTPUEmbeddingAdagradMomentumParametersr  rT   r$  )r>   r?   r   r   rB   rF   r&  r  r  s
             rP   r'  r'          \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&M|6s"&(' ""$7vwX@FFwO'	.rn   %RetrieveTPUEmbeddingAdagradParametersc                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a  Retrieve Adagrad embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, accumulators).

    parameters: A `Tensor` of type `float32`.
    accumulators: A `Tensor` of type `float32`.
  r+  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   ,_RetrieveTPUEmbeddingAdagradParametersOutputr  r7   r8   r9   r:   r;   8retrieve_tpu_embedding_adagrad_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   )retrieve_tpu_embedding_adagrad_parametersr/    s?   , 
			0h..0$#\\
115tZ,
L*Hh0g =BB7Kgn   \:*x4(Hx4(J  \:*^FVX.&'88/J:B:B<F8>TK!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L/vwP8>>wG'	.M && -
##At,,## 
E
zF4A A ## 
r  z-raw_ops.RetrieveTPUEmbeddingAdagradParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s%   RetrieveTPUEmbeddingAdagradParameters   rT   r+  )r>   r?   r   r   rB   rF   r-  r  r  s
             rP   r.  r.          \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&Eq$0C"&(' ""$/vwP8>>wG'	.rn   -RetrieveTPUEmbeddingCenteredRMSPropParameters)rp  r  r  r  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a<  Retrieve centered RMSProp embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, ms, mom, mg).

    parameters: A `Tensor` of type `float32`.
    ms: A `Tensor` of type `float32`.
    mom: A `Tensor` of type `float32`.
    mg: A `Tensor` of type `float32`.
  r3  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   4_RetrieveTPUEmbeddingCenteredRMSPropParametersOutputr  r7   r8   r9   r:   r;   Bretrieve_tpu_embedding_centered_rms_prop_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   3retrieve_tpu_embedding_centered_rms_prop_parametersr7    A   0 
			0h..0$#\\
11=tHlJJ(F<g EJJ7Sgn   \:*x4(Hx4(J  \:*^FVX.&'887JBJBJDN@F>BD!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L7vwX@FFwO'	.O && -
##At,,## 
O
zF4A A ## 
r  z5raw_ops.RetrieveTPUEmbeddingCenteredRMSPropParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s-   RetrieveTPUEmbeddingCenteredRMSPropParameters   rT   r3  )r>   r?   r   r   rB   rF   r5  r  r  s
             rP   r6  r6  `  r*  rn   "RetrieveTPUEmbeddingFTRLParameters)rp  r  r  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a"  Retrieve FTRL embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, accumulators, linears).

    parameters: A `Tensor` of type `float32`.
    accumulators: A `Tensor` of type `float32`.
    linears: A `Tensor` of type `float32`.
  r;  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   )_RetrieveTPUEmbeddingFTRLParametersOutputr  r7   r8   r9   r:   r;   5retrieve_tpu_embedding_ftrl_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   &retrieve_tpu_embedding_ftrl_parametersr?  }  r  r  z*raw_ops.RetrieveTPUEmbeddingFTRLParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s"   RetrieveTPUEmbeddingFTRLParametersr  rT   r;  )r>   r?   r   r   rB   rF   r=  r  r  s
             rP   r>  r>    r  rn   0RetrieveTPUEmbeddingFrequencyEstimatorParametersc                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a  Retrieve frequency estimator embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, last_hit_step).

    parameters: A `Tensor` of type `float32`.
    last_hit_step: A `Tensor` of type `float32`.
  rA  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   7_RetrieveTPUEmbeddingFrequencyEstimatorParametersOutputr  r7   r8   r9   r:   r;   Dretrieve_tpu_embedding_frequency_estimator_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   5retrieve_tpu_embedding_frequency_estimator_parametersrE    sB   , 
			0h..0$#\\
11@$HlJJ(F<g HMMgVgn   \:*x4(Hx4(J  \:*^FVX.&'88:zEMEMGQCIAEG!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L:L&RY[CII'R'	.O && -
##At,,## 
Q
zF4A A ## 
r  z8raw_ops.RetrieveTPUEmbeddingFrequencyEstimatorParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s0   RetrieveTPUEmbeddingFrequencyEstimatorParametersr1  rT   rA  )r>   r?   r   r   rB   rF   rC  r  r  s
             rP   rD  rD  2  s      \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&P|6s"&(' ""$:L&RY[CII'R'	.rn   -RetrieveTPUEmbeddingMDLAdagradLightParameters)rp  r  r  r  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)ae  Retrieve MDL Adagrad Light embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, accumulators, weights, benefits).

    parameters: A `Tensor` of type `float32`.
    accumulators: A `Tensor` of type `float32`.
    weights: A `Tensor` of type `float32`.
    benefits: A `Tensor` of type `float32`.
  rG  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   4_RetrieveTPUEmbeddingMDLAdagradLightParametersOutputr  r7   r8   r9   r:   r;   Bretrieve_tpu_embedding_mdl_adagrad_light_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   3retrieve_tpu_embedding_mdl_adagrad_light_parametersrK  O  r8  r  z5raw_ops.RetrieveTPUEmbeddingMDLAdagradLightParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s-   RetrieveTPUEmbeddingMDLAdagradLightParametersr:  rT   rG  )r>   r?   r   r   rB   rF   rI  r  r  s
             rP   rJ  rJ    r*  rn   &RetrieveTPUEmbeddingMomentumParametersc                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a  Retrieve Momentum embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, momenta).

    parameters: A `Tensor` of type `float32`.
    momenta: A `Tensor` of type `float32`.
  rM  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   -_RetrieveTPUEmbeddingMomentumParametersOutputr  r7   r8   r9   r:   r;   9retrieve_tpu_embedding_momentum_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   *retrieve_tpu_embedding_momentum_parametersrQ    s?   , 
			0h..0$#\\
116j,
L*Hh0g >CCGLgn   \:*x4(Hx4(J  \:*^FVX.&'880Z;C;C=G9?dL!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L0,Q9??H'	.M && -
##At,,## 
F
zF4A A ## 
r  z.raw_ops.RetrieveTPUEmbeddingMomentumParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s&   RetrieveTPUEmbeddingMomentumParametersr1  rT   rM  )r>   r?   r   r   rB   rF   rO  r  r  s
             rP   rP  rP    r#  rn   -RetrieveTPUEmbeddingProximalAdagradParametersc                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a  Retrieve proximal Adagrad embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, accumulators).

    parameters: A `Tensor` of type `float32`.
    accumulators: A `Tensor` of type `float32`.
  rS  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   4_RetrieveTPUEmbeddingProximalAdagradParametersOutputr  r7   r8   r9   r:   r;   Aretrieve_tpu_embedding_proximal_adagrad_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   2retrieve_tpu_embedding_proximal_adagrad_parametersrW  "  sA   , 
			0h..0$#\\
11=tHlJJ(F<g EJJ7Sgn   \:*x4(Hx4(J  \:*^FVX.&'887JBJBJDN@F>BD!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L7vwX@FFwO'	.O && -
##At,,## 
N
zF4A A ## 
r  z5raw_ops.RetrieveTPUEmbeddingProximalAdagradParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s-   RetrieveTPUEmbeddingProximalAdagradParametersr1  rT   rS  )r>   r?   r   r   rB   rF   rU  r  r  s
             rP   rV  rV  n  r*  rn   *RetrieveTPUEmbeddingProximalYogiParameters)rp  r  r  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a  TODO: add doc.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, v, m).

    parameters: A `Tensor` of type `float32`.
    v: A `Tensor` of type `float32`.
    m: A `Tensor` of type `float32`.
  rY  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   1_RetrieveTPUEmbeddingProximalYogiParametersOutputr  r7   r8   r9   r:   r;   >retrieve_tpu_embedding_proximal_yogi_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   /retrieve_tpu_embedding_proximal_yogi_parametersr]    sA   $ 
			0h..0$#\\
11:D*,
L*Hh0g BGGPgn   \:*x4(Hx4(J  \:*^FVX.&'884?G?GAK=C;?A!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L4lFGU=CCGL'	.O && -
##At,,## 
K
zF4A A ## 
r  z2raw_ops.RetrieveTPUEmbeddingProximalYogiParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s*   RetrieveTPUEmbeddingProximalYogiParametersr  rT   rY  )r>   r?   r   r   rB   rF   r[  r  r  s
             rP   r\  r\    s      \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&JA$0C"&(' ""$4lFGU=CCGL'	.rn   %RetrieveTPUEmbeddingRMSPropParameters)rp  r  r  c                 j   t         j                   xs t        j                         }|j                  }|j                  r9	 t	        j
                  |d|d|d|d| d|d|      }t        j                  |      }|S t        j                   | d      } t        j                   |d      }|d	}t        j                   |d      }|d
}t        j"                  |d      }|d
}t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j-                  d      d|j+                  d      d|j+                  d      d|j-                  d      f
}|j.                  }t        j0                  d|||       t        j                  |      }|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)a	  Retrieve RMSProp embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (parameters, ms, mom).

    parameters: A `Tensor` of type `float32`.
    ms: A `Tensor` of type `float32`.
    mom: A `Tensor` of type `float32`.
  r_  ru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   ,_RetrieveTPUEmbeddingRMSPropParametersOutputr  r7   r8   r9   r:   r;   9retrieve_tpu_embedding_rms_prop_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   *retrieve_tpu_embedding_rms_prop_parametersrc    s?   . 
			0h..0$#\\
115tZ,
L*Hh0g =BB7Kgn   \:*x4(Hx4(J  \:*^FVX.&'88/J:B:B<F8>TK!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::L/vwP8>>wG'	.M && -
##At,,## 
F
zF4A A ## 
r  z-raw_ops.RetrieveTPUEmbeddingRMSPropParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       t        j                  |	      }	|	S )Nrs  rt  r   ru  r   rv  r   s%   RetrieveTPUEmbeddingRMSPropParametersr  rT   r_  )r>   r?   r   r   rB   rF   ra  r  r  s
             rP   rb  rb  <  r2  rn   c                    t         j                   xs t        j                         }|j                  }|j                  r$	 t	        j
                  |d|d|d|d| d|d|      }|S t        j                  | d      } t        j                  |d      }|d	}t        j                  |d      }|d
}t        j                  |d      }|d
}t        j                  |d      }t!        j"                  d| |||||      \  }
}
}}|dd }t        j$                         r{d|j'                  d      d|j)                  d      d|j'                  d      d|j'                  d      d|j)                  d      f
}|j*                  }t        j,                  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)at  Retrieve SGD embedding parameters.

  An op that retrieves optimization parameters from embedding to host
  memory. Must be preceded by a ConfigureTPUEmbeddingHost op that sets up
  the correct embedding table configuration. For example, this op is
  used to retrieve updated parameters before saving a checkpoint.

  Args:
    num_shards: An `int`.
    shard_id: An `int`.
    table_id: An optional `int`. Defaults to `-1`.
    table_name: An optional `string`. Defaults to `""`.
    config: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`.
  7RetrieveTPUEmbeddingStochasticGradientDescentParametersru  rv  rs  rt  r   Nry  r   r   r  )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   Lretrieve_tpu_embedding_stochastic_gradient_descent_parameters_eager_fallbackr=   r>   r?   r   r@   rA   rB   rD   r   rE   rF   r  s                  rP   =retrieve_tpu_embedding_stochastic_gradient_descent_parametersrh  U  s)   & 
			0h..0$#\\	11GHlJJ(F<g n   \:*x4(Hx4(J  \:*^FVX.&'88AjLTLTNXJPHLN!QX QK'""$#++J7ll<(,-z
+Xs||H7MOF ::LA<QWY`b('	.O && -
##At,,## 
Y
zF4A A ## 
s0    "F G+GGG#G5 5HHz?raw_ops.RetrieveTPUEmbeddingStochasticGradientDescentParametersc           
         t        j                  | d      } t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }g }d|d|d| d|d|f
}t        j                  dd	||||
      }	t        j                         rt        j
                  d|||	       |	\  }	|	S )Nrs  rt  r   ru  r   rv  r   s7   RetrieveTPUEmbeddingStochasticGradientDescentParametersrS   rT   rf  r  r  s
             rP   rg  rg    s      \:*x4(Hx4(J  \:*^FVX.&,,
Lj(Hf6&W|6s"&(' ""$A<QWY`b('	.rn   learning_ratesc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |d|      }|S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d|z        t#        |      }	t%        j&                  |d      }t)        j*                  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)a  Performs gradient updates of embedding tables.

  Args:
    inputs: A list of at least 1 `Tensor` objects with type `float32`.
      A TensorList of gradients with which to update embedding tables.
      This argument has the same length and shapes as the return value of
      RecvTPUEmbeddingActivations, but contains gradients of the model's loss
      with respect to the embedding activations. The embedding tables are updated
      from these gradients via the optimizer specified in the TPU embedding
      configuration given to tpu.initialize_system.
    learning_rates: A list of `Tensor` objects with type `float32`.
      A TensorList of float32 scalars, one for each dynamic learning
      rate tag: see the comments in
      //third_party/tensorflow/core/protobuf/tpu/optimization_parameters.proto.
      Multiple tables can share the same dynamic learning rate tag as specified
      in the configuration. If the learning rates for all tables are constant,
      this list should be empty.
    config: A `string`. Serialized TPUEmbeddingConfiguration proto.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  SendTPUEmbeddingGradientsr   Nr   QExpected list for 'inputs' argument to 'send_tpu_embedding_gradients' Op, not %r.YExpected list for 'learning_rates' argument to 'send_tpu_embedding_gradients' Op, not %r.)rE   rj  r   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   +send_tpu_embedding_gradients_eager_fallbackr=   r   r   r   r   r   r>   r   r@   rA   )rE   rj  r   r0   rG   rH   rI   rJ   r   _attr_NNrK   rL   rM   s                rP   send_tpu_embedding_gradientsrq    sz   0 
			0h..0$#\\11)4&g n 
FT5M	*
	57=	>? ? K'	NT5M	2
	57E	FG G  (VX.&'88#F4B,2?!QX 
*3 && -
##At,,## 
8
.dF F## 
s0    C2 2D9D  D98D9=E E$#E$z!raw_ops.SendTPUEmbeddingGradientsc                    t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        t	        |      }t        j                  |d      }t        j                  | t        j                        } t        j                  |t        j                        }t        |       t        |      z   }d|d|d|f}t        j                  dd||||      }	d }	|	S )	Nrm  rn  r   r   NNs   SendTPUEmbeddingGradientsr   rT   )r   r   r   r   r   r>   r   r9   r  rW   rX   r   )
rE   rj  r   r0   r1   r   rp  rO   rN   rI   s
             rP   ro  ro    s    	FT5M	*
	57=	>? ? K'	NT5M	2
	57E	FG G  (VX.&##FGOO<&++NGOOL.f^ 44,$(F;&91$0C"&(' '	.rn   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|       }|S t        j                  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)zShuts down a running distributed TPU system.

  The op returns an error if no system is running.

  Args:
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  ShutdownDistributedTPUNr   r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   'shutdown_distributed_tpu_eager_fallbackr=   r@   rA   )r0   rG   rH   rI   rJ   rK   rL   rM   s           rP   shutdown_distributed_tpurx  
  s     
			0h..0$#\\11&.gn (88 t-!QX	* && -
##At,,## 
4 ## 
s0    A7 7B>
B%%B>=B>C C%$C%zraw_ops.ShutdownDistributedTPUc                 H    g }d }t        j                  dd||||       }d }|S )Ns   ShutdownDistributedTPUr   rT   )r>   r   r0   r1   rO   rN   rI   s        rP   rw  rw  ,  s7    ,&6$0C"&(' '	.rn   c                 V   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|       }|S t        j                  d|       \  }}}}|dd }t        j                          r&d}|j"                  }	t        j$                  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)aI  Returns the result of a TPU compilation.

  This operation returns the result of a TPU compilation as a serialized
  CompilationResultProto, which holds a status and an error message if an error
  occurred during compilation.

  Args:
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `string`.
  TPUCompilationResultNr   rv   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   %tpu_compilation_result_eager_fallbackr=   r@   rA   r>   rB   rE   rF   
r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s
             rP   tpu_compilation_resultr  6  s"    
			0h..0$#\\11$d,gn (88T+!QXQK'""$F::Lfg?('	.' && -
##At,,## 
2 ## 
0    B: :DC((D DD D('D(zraw_ops.TPUCompilationResultc                     g }d }t        j                  dd||||       }t        j                         rt        j                  d|||       |\  }|S )Ns   TPUCompilationResultrS   rT   r|  r>   r   rB   rF   rz  s        rP   r~  r~  b  sY    ,&4a#)s?'""$fg?('	.rn   embedding_variablesliced_activations	lookup_idc                    t         j                   xs t        j                         }|j                  }|j                  r 	 t	        j
                  |d|| |d|d|	      }|S t        j                  |d      }t        j                  |d      }t        j                   d| ||||      \  }	}	}
}|dd }t        j"                         rHd|
j%                  d      d|
j%                  d      f}|
j&                  }t        j(                  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)a  An op enabling differentiation of TPU Embeddings.

  This op simply returns its first input, which is assumed to have been sliced
  from the Tensors returned by TPUEmbeddingDequeueActivations. The presence of
  this op, and its first argument being a trainable Variable, enables automatic
  differentiation of graphs containing embeddings via the TPU Embedding Python
  libraries.

  Args:
    embedding_variable: A `Tensor` of type `float32`.
      A trainable variable, enabling optimizers to find this op.
    sliced_activations: A `Tensor` of type `float32`.
      The embedding activations Tensor to return.
    table_id: An `int` that is `>= 0`.
      The id of the table in the embedding layer configuration from which
      these activations were computed.
    lookup_id: An `int` that is `>= 0`.
      Identifier of the set of embedding indices which produced these
      activations.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`.
  TPUEmbeddingActivationsru  r  N)ru  r  r0   r1   )r  r  ru  r  r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   (tpu_embedding_activations_eager_fallbackr=   r>   r?   r@   rA   rB   rD   rE   rF   )r  r  ru  r  r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s                 rP   tpu_embedding_activationsr  n  s   2 
			0h..0$#\\11'/AJ+yJg n x4(	;7)'88!6H6H,4	(,	.!QX
 QK'""$#++J7,.F::L!<B('	.5 && -
##At,,## 
5
08Dd4 4 ## 
s0    D E%E  EEE. .FFzraw_ops.TPUEmbeddingActivationsc                    t        j                  |d      }t        j                  |d      }t        j                  | t        j
                        } t        j                  |t        j
                        }| |g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nru  r  s   TPUEmbeddingActivationsrS   rT   r  )	r>   r?   r9   rl   rW   rX   r   rB   rF   )	r  r  ru  r  r0   r1   rO   rN   rI   s	            rP   r  r    s    x4(	;7)--.@'//R--.@'//R$&89,+y9&7$0C"&(' ""$!<B('	.rn   c                 V   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|       }|S t        j                  d|       \  }}}}|dd }t        j                          r&d}|j"                  }	t        j$                  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)a1  A TPU core selector Op.

  This Op produces a set of TPU cores (for warm-up) or a single TPU core
  (for regular inference) to execute the TPU program on. The output is
  consumed by TPUPartitionedCall.

  Args:
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `int32`.
  TPUOrdinalSelectorNr   rv  r}  )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   #tpu_ordinal_selector_eager_fallbackr=   r@   rA   r>   rB   rE   rF   r  s
             rP   tpu_ordinal_selectorr    s"    
			0h..0$#\\11"D*gn (884)!QXQK'""$F::LlFG=('	.' && -
##At,,## 
0 ## 
r  zraw_ops.TPUOrdinalSelectorc                     g }d }t        j                  dd||||       }t        j                         rt        j                  d|||       |\  }|S )Ns   TPUOrdinalSelectorrS   rT   r  r  rz  s        rP   r  r    sY    ,&2Al#)s?'""$lFG=('	.rn   autotuner_threshc                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |d|d|d|      }|S t        |t        t        f      st!        d|z        |D 
cg c]  }
t#        j$                  |
d       }}
|d}t#        j&                  |d      }t)        j*                  d| |||||	      \  }}}}|dd }t#        j,                         rjd
|j/                  d
      d|j/                  d      d|j/                  d      d|j1                  d      f}|j2                  }t#        j4                  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 zw xY wc c}
w )a  Calls a function placed on a specified TPU device.

  Args:
    args: A list of `Tensor` objects. The arguments to the function.
    device_ordinal: A `Tensor` of type `int32`.
      The TPU device ordinal to run the function on.
    Tout: A list of `tf.DTypes`. The types of the outputs of the function.
    f: A function decorated with @Defun. The function to call.
    autotuner_thresh: An optional `int`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A list of `Tensor` objects of type `Tout`.
  TPUPartitionedCallToutfr  N)r  r  r  r0   r1   GExpected list for 'Tout' argument to 'tpu_partitioned_call' Op, not %r.r   )argsr   r  r  r  r0   Tin)r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   #tpu_partitioned_call_eager_fallbackr=   r   r   r   r   r>   rC  r?   r@   rA   rB   r   rD   rE   rF   )r  r   r  r  r  r0   rG   rH   rI   rJ   rO  rK   rL   rM   rN   rO   s                   rP   tpu_partitioned_callr    s    
			0h..0$#\\11"D$Q"$46g n 
D4-	(
	-/3	45 5 48	8R(

R
(	8$	8&&'79KL'884#'1/?dL!QX QK'""$S\\%(&#,,v2Fll3!3 235F ::LlFG=	.? && -
##At,,## 
0
TQ+$DB B ## 
 
9s6     E( 	G(F/;FF/.F/3G GGzraw_ops.TPUPartitionedCallc                    t        |t        t        f      st        d|z        |D cg c]  }t	        j
                  |d       }}|d}t	        j                  |d      }t	        j                  | |      \  }} t        j                  |t        j                        }t        |       |gz   }	d|d|d|d|f}
t	        j                  dt        |      |	|
||      }t	        j                         rt	        j                  d	|	|
|       |S c c}w )
Nr  r  r   r  r  r  s   TPUPartitionedCallrT   r  )r   r   r   r   r>   rC  r?   ri  r9   rl   rW   rZ   r   r   rB   rF   )r  r   r  r  r  r0   r1   rO  	_attr_TinrO   rN   rI   s               rP   r  r  2  s   	D4-	(
	-/3	45 5 48	8R(

R
(	8$	8&&'79KL;;D#F/)T)).'--H.d~..,9fdC4F&2CI$0C"&(' ""$lFG=	. 
9s   D
rS   STEP_MARK_AT_ENTRYnum_replicasnum_cores_per_replicatopologyuse_tpustep_marker_locationallow_soft_placementuse_spmd_for_xla_partitioningtpu_compile_options_protoc                 J   t         j                   xs t        j                         }|j                  }|j                  r2	 t	        j
                  |d|d| d|d|d|d|d|d|d	|d
|d|	d|
d|      }|S t        j                  | d      } |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                   |d      }|g }t#        |t$        t&        f      st)        d|z        |D cg c]  }t        j                  |d       }}|g }t#        |t$        t&        f      st)        d|z        |D cg c]  }t        j                  |d       }}|g }t#        |t$        t&        f      st)        d|z        |D cg c]  }t        j                  |d       }}|g }t#        |t$        t&        f      st)        d|z        |D cg c]  }t        j                  |d	       }}|d}t        j                  |d
      }|	d}	t        j                   |	d      }	|
d}
t        j                   |
d      }
|d}t        j                  |d      }t+        j,                  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 c c}w c c}w c c}w )ag  Metadata indicating how the TPU computation should be replicated.

  This operation holds the metadata common to operations of a `tpu.replicate()` computation subgraph.

  Args:
    num_replicas: An `int` that is `>= 0`.
      Number of replicas of the computation
    num_cores_per_replica: An optional `int`. Defaults to `1`.
      Number of cores per replica. Used for model parallelism.
    topology: An optional `string`. Defaults to `""`.
      TopologyProto indicating the topology of the TPU pod slice.
    use_tpu: An optional `bool`. Defaults to `True`.
      Whether to place the computation on the TPU.
    device_assignment: An optional list of `ints`. Defaults to `[]`.
      The assignment of devices for the computation.
    computation_shape: An optional list of `ints`. Defaults to `[]`.
      DEPRECATED. Use num_cores_per_replica instead.
    host_compute_core: An optional list of `strings`. Defaults to `[]`.
    padding_map: An optional list of `strings`. Defaults to `[]`.
    step_marker_location: An optional `string`. Defaults to `"STEP_MARK_AT_ENTRY"`.
    allow_soft_placement: An optional `bool`. Defaults to `False`.
    use_spmd_for_xla_partitioning: An optional `bool`. Defaults to `False`.
    tpu_compile_options_proto: An optional `string`. Defaults to `""`.
    name: A name for the operation (optional).

  Returns:
    The created Operation.
  TPUReplicateMetadatar  r  r  r  device_assignmentcomputation_shapehost_compute_corepadding_mapr  r  r  r  N)r  r  r  r  r  r  r  r  r  r  r  r  r0   r1   rS   r   TVExpected list for 'device_assignment' argument to 'tpu_replicate_metadata' Op, not %r.VExpected list for 'computation_shape' argument to 'tpu_replicate_metadata' Op, not %r.VExpected list for 'host_compute_core' argument to 'tpu_replicate_metadata' Op, not %r.PExpected list for 'padding_map' argument to 'tpu_replicate_metadata' Op, not %r.r  F)r  r  r  r  r  r  r  r  r  r  r  r  r0   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   %tpu_replicate_metadata_eager_fallbackr=   r>   r?   r   r   r   r   r   r   r@   rA   )r  r  r  r  r  r  r  r  r  r  r  r  r0   rG   rH   rI   rJ   r   r   rK   rL   rM   s                         rP   tpu_replicate_metadatar  I  s   : 
			0h..0$#\\11$dNL!6
H7/1B.0C=+7M46J')F#%>@g n( ""<@,""++,ACZ[Hx4(_Gw	2'	%e}	5
	/1B	CD D M^^bx((-@A^^	%e}	5
	/1B	CD D M^^bx((-@A^^	%e}	5
	/1B	CD D M^^bx((-@A^^K	K$	/
	/1<	=> > ALL"""2}5L+L!/!**+?AWX! !++,@BXY"*$)!"*"4"45RTs"t& "&//0IKfg'88\6K)172C2C2C,75I5I>[:S%)+!QX 
*e && -
##At,,## 
2# 5->--;33(E$=D
 
 ## 
& _ _ _ MsH    0J LLL"L K&KKKK7 7LLzraw_ops.TPUReplicateMetadatac                    t        j                  | d      } |d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }|g }t	        |t
        t        f      st        d|z        |D cg c]  }t        j                  |d	       }}|g }t	        |t
        t        f      st        d
|z        |D cg c]  }t        j                  |d       }}|g }t	        |t
        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t	        |t
        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|d}t        j                  |d      }|	d}	t        j                  |	d      }	|
d}
t        j                  |
d      }
|d}t        j                  |d      }g }d| d|d|d|d	|d|d|d|d|d|	d|
d|f}t        j                  dd||||      }d }|S c c}w c c}w c c}w c c}w )Nr  rS   r  r   r  Tr  r  r  r  r  r  r  r  r  r  r  Fr  r  r  s   TPUReplicateMetadatar   rT   )	r>   r?   r   r   r   r   r   r   r   )r  r  r  r  r  r  r  r  r  r  r  r  r0   r1   r   r   rO   rN   rI   s                      rP   r  r    s   ""<@,""++,ACZ[Hx4(_Gw	2'	%e}	5
	/1B	CD D M^^bx((-@A^^	%e}	5
	/1B	CD D M^^bx((-@A^^	%e}	5
	/1B	CD D M^^bx((-@A^^K	K$	/
	/1<	=> > ALL"""2}5L+L!/!**+?AWX! !++,@BXY"*$)!"*"4"45RTs"t& "&//0IKfg,L*AXy'(*=(*;]%';.!#@8:& 4a#)s?''	.] _ _ _ Ms   H4H9'H>2I) TV_TPUReplicatedInput_Tr   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   is_mirrored_variableindex	is_packedc                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S t        | t        t        f      st!        d| z        t#        |       }	|d}t%        j&                  |d      }|d	}t%        j(                  |d      }|d}t%        j&                  |d      }t+        j,                  d| ||||
      \  }
}
}}|dd }t%        j.                         r{d|j1                  d      d|j3                  d      d|j5                  d      d|j1                  d      d|j5                  d      f
}|j6                  }t%        j8                  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)a-  Connects N inputs to an N-way replicated TPU computation.

  This operation holds a replicated input to a `tpu.replicate()` computation subgraph.
  Each replicated input has the same shape and type alongside the output.

  For example:
  ```
  %a = "tf.opA"()
  %b = "tf.opB"()
  %replicated_input = "tf.TPUReplicatedInput"(%a, %b)
  %computation = "tf.Computation"(%replicated_input)
  ```
  The above computation has a replicated input of two replicas.

  Args:
    inputs: A list of at least 1 `Tensor` objects with the same type.
    is_mirrored_variable: An optional `bool`. Defaults to `False`.
    index: An optional `int`. Defaults to `-1`.
    is_packed: An optional `bool`. Defaults to `False`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `inputs`.
  TPUReplicatedInputr  r  r  N)r  r  r  r0   r1   IExpected list for 'inputs' argument to 'tpu_replicated_input' Op, not %r.Fr   )rE   r  r  r  r0   r   r2   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   #tpu_replicated_input_eager_fallbackr=   r   r   r   r   r   r>   r   r?   r@   rA   rB   rD   rC   r   rE   rF   )rE   r  r  r  r0   rG   rH   rI   rJ   r   rK   rL   rM   rN   rO   s                  rP   tpu_replicated_inputr    s1   2 
			0h..0$#\\11"D&2Hguk9Fg n 
FT5M	*
	-/5	67 7 K'! !++,@BXY
]E


E7
+%I  K8)'88V3G$)YTK!QX QK'""$3$$S)30B0B30G$  !78'(+  -	/F
 ::LlFG=('	.Q && -
##At,,## 
0
';5Dd4 4 ## 
s0    F G*GGG"G3 3H
	H
zraw_ops.TPUReplicatedInputc           
      
   t        | t        t        f      st        d| z        t	        |       }|d}t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  t        |       |g       \  }} t        |       }d|d|d|d|d|f
}	t        j                  d	d
||	||      }
t        j                         rt        j                  d||	|
       |
\  }
|
S )Nr  Fr  r   r  r  r   r2   s   TPUReplicatedInputrS   rT   r  )r   r   r   r   r   r>   r   r?   rV   r   rB   rF   )rE   r  r  r  r0   r1   r   rm   rO   rN   rI   s              rP   r  r  \  s    	FT5M	*
	-/5	67 7 K'! !++,@BXY
]E


E7
+%I  K8)33DL#rJ/'6f,#w(>Y@&2Al#)s?'""$lFG=('	.rn   ) TV_TPUReplicatedOutput_Tr   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c                    t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|      }|S t        j                  |d      }t        j                   d| ||      \  }}}}	|	dd }t        j"                         rHd|j%                  d      d|j'                  d      f}
|j(                  }t        j*                  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)ax  Connects N outputs from an N-way replicated TPU computation.

  This operation holds a replicated output from a `tpu.replicate()` computation subgraph.
  Each replicated output has the same shape and type alongside the input.

  For example:
  ```
  %computation = "tf.Computation"()
  %replicated_output:2 = "tf.TPUReplicatedOutput"(%computation)
  ```
  The above computation has a replicated output of two replicas.

  Args:
    input: A `Tensor`.
    num_replicas: An `int` that is `>= 1`.
    name: A name for the operation (optional).

  Returns:
    A list of `num_replicas` `Tensor` objects with the same type as `input`.
  TPUReplicatedOutputr  N)r  r0   r1   )r(   r  r0   r2   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   $tpu_replicated_output_eager_fallbackr=   r>   r?   r@   rA   rB   rD   rC   rE   rF   )r(   r  r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s               rP   tpu_replicated_outputr  z  se   * 
			0h..0$#\\11#T5.g n ""<@,'88U$(*!QX QK'""$c//?  %'F::L|VW>	.+ && -
##At,,## 
1
l4A A## 
s0    C3 3D:D!!D:9D:>E E$#E$zraw_ops.TPUReplicatedOutputc                    t        j                  |d      }t        j                  | g|g       \  }\  } | g}d|d|f}t        j                  d|||||      }t        j                         rt        j
                  d|||       |S )Nr  r2   s   TPUReplicatedOutputrT   r  )r>   r?   rV   r   rB   rF   )r(   r  r0   r1   rm   rO   rN   rI   s           rP   r  r    s    ""<@,55ugsBG'8E,L#w7&3\$0C"&(' ""$|VW>	.rn   requestc                 \   t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d||       }|S t        j                  d| |      \  }}}}|dd }t        j                          r&d}	|j"                  }
t        j$                  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)a  Worker heartbeat op.

  Heartbeats may be sent periodically to indicate the coordinator is still active,
  to retrieve the current worker status and to expedite shutdown when necessary.

  Args:
    request: A `Tensor` of type `string`.
      A string tensor containing a serialized WorkerHeartbeatRequest
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `string`.
  WorkerHeartbeatNr   )r  r0   r}  )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   worker_heartbeat_eager_fallbackr=   r@   rA   r>   rB   rE   rF   )r  r0   rG   rH   rI   rJ   rK   rL   rM   rN   rO   s              rP   worker_heartbeatr    s(    
			0h..0$#\\11w0gn (8877!QXQK'""$F::L<:('	.' && -
##At,,## 
,
$( (## 
s0    B< <DC**DDD D+*D+zraw_ops.WorkerHeartbeatc                     t        j                  | t        j                        } | g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       |\  }|S )Ns   WorkerHeartbeatrS   rT   r  )r9   rl   rW   r   r>   r   rB   rF   )r  r0   r1   rO   rN   rI   s         rP   r  r    sq    ""7GNN;',&/<#)s?'""$<:('	.rn   ) TV_XlaConcatND_Tr   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| d|d|      }|S t        | t        t        f      st!        d| z        t#        |       }t        |t        t        f      st!        d|z        |D 	cg c]  }	t%        j&                  |	d       }}	|g }t        |t        t        f      st!        d|z        |D 	cg c]  }	t%        j&                  |	d       }}	t)        j*                  d| |||	      \  }
}
}}|dd }t%        j,                         rjd
|j/                  d
      d|j1                  d      d|j3                  d      d|j3                  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 c c}	w )a  Concats input tensor across all dimensions.

  An op which merges slices the input tensor based on the given num_splits
  attribute, strips paddings optionally, and returns the merged tensor without
  paddings.

  This op may be generated via the TPU bridge.

  For example, with `input` tensor:
  ```
  [[0, 1],
   [4, 5]]
  [[2, 3],
   [6, 7]]
  [[8, 9],
   [12, 13]]
  [[10, 11],
   [14, 15]]
  ```
  `num_splits`:
  ```
  [2, 2]
  ```
  and `paddings`:
  ```
  [1, 1]
  ```
  the expected `outputs` is:
  ```
  [[0, 1, 2],
   [4, 5, 6],
   [8, 9, 10]]
  ```

  Args:
    inputs: A list of at least 1 `Tensor` objects with the same type.
      Input tensor slices in row-major order to merge across all dimensions. All
      inputs must have the same shape.
    num_concats: A list of `ints`. Number of ways to merge per dimension.
    paddings: An optional list of `ints`. Defaults to `[]`.
      Optional list of right paddings per dimension to strip from the final merged
      tensor. These paddings must not exceed the dimension size of the merged result
      prior to stripping paddings.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `inputs`.
  XlaConcatNDr~   r   Nr   BExpected list for 'inputs' argument to 'xla_concat_nd' Op, not %r.GExpected list for 'num_concats' argument to 'xla_concat_nd' Op, not %r.DExpected list for 'paddings' argument to 'xla_concat_nd' Op, not %r.)rE   r~   r   r0   r2   r   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   xla_concat_nd_eager_fallbackr=   r   r   r   r   r   r>   r?   r@   rA   rB   rC   rD   r   rE   rF   )rE   r~   r   r0   rG   rH   rI   rJ   r   r   rK   rL   rM   rN   rO   s                  rP   xla_concat_ndr    sa   b 
			0h..0$#\\11mT6=+Hg n 
FT5M	*
	&(.	/0 0 K'	K$	/
	&(3	45 5 ALL"""2}5L+LH	HtUm	,
	&(0	12 2 ;CCBhJ/C(C'88f+ (t5!QX QK'""$3%%c*C1B1B31GS\\-8*ll:&(F ::L|VW6('	.Q && -
##At,,## 
)
kH4  ## 
 M Ds<    G 5H< IHG55HHH" "H98H9zraw_ops.XlaConcatNDc                    t        | t        t        f      st        d| z        t	        |       }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  t        |       |g       \  }} t        |       }d|d|d|d|f}	t        j                  dd	||	||
      }
t        j                         rt        j                  d||	|
       |
\  }
|
S c c}w c c}w )Nr  r  r~   r  r   r2   r   s   XlaConcatNDrS   rT   r  )r   r   r   r   r   r>   r?   rV   r   rB   rF   )rE   r~   r   r0   r1   r   r   rm   rO   rN   rI   s              rP   r  r  a  sm   	FT5M	*
	&(.	/0 0 K'	K$	/
	&(3	45 5 ALL"""2}5L+LH	HtUm	,
	&(0	12 2 ;CCBhJ/C(C33DL#rJ/'6f,#w{h&^Q|#)s?'""$|VW6('	.% M Ds   E#E) TV_XlaSplitND_Tr   r   r   r   rp   r   r   rq   rr   rs   rt   ru   r   r   r   rv   r   r   r   r    r!   r"   r#   rw   rx   r$   r%   ry   r&   r'   rz   c                 Z   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       }}	|g }t        |t         t"        f      st%        d|z        |D 	cg c]  }	t        j                  |	d       }}	t'        j(                  d| ||||	      \  }
}
}}|dd }t        j*                         rjd
|j-                  d
      d|j/                  d      d|j1                  d      d|j1                  d      f}|j2                  }t        j4                  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 c c}	w )at  Splits input tensor across all dimensions.

  An op which slices the input tensor based on the given num_splits attribute,
  pads slices optionally, and returned the slices. Slices are returned in
  row-major order.

  This op may be generated via the TPU bridge.

  For example, with `input` tensor:
  ```
  [[0, 1, 2],
   [3, 4, 5],
   [6, 7, 8]]
  ```
  `num_splits`:
  ```
  [2, 2]
  ```
  and `paddings`:
  ```
  [1, 1]
  ```
  the expected `outputs` is:
  ```
  [[0, 1],
   [3, 4]]
  [[2, 0],
   [5, 0]]
  [[6, 7],
   [0, 0]]
  [[8, 0],
   [0, 0]]
  ```

  Args:
    input: A `Tensor`. Input tensor to split across all dimensions.
    N: An `int` that is `>= 1`.
    num_splits: A list of `ints`.
      Number of ways to split per dimension. Shape dimensions must be evenly
      divisible.
    paddings: An optional list of `ints`. Defaults to `[]`.
      Optional list of right paddings per dimension of input tensor to apply before
      splitting. This can be used to make a dimension evenly divisible.
    name: A name for the operation (optional).

  Returns:
    A list of `N` `Tensor` objects with the same type as `input`.
  
XlaSplitNDr   r  r   N)r   r  r   r0   r1   EExpected list for 'num_splits' argument to 'xla_split_nd' Op, not %r.CExpected list for 'paddings' argument to 'xla_split_nd' Op, not %r.)r(   r   r  r   r0   r2   )r3   r   r4   r5   r   r6   r7   r8   r9   r:   r;   xla_split_nd_eager_fallbackr=   r>   r?   r   r   r   r   r@   rA   rB   rC   rD   r   rE   rF   )r(   r   r  r   r0   rG   rH   rI   rJ   r   rK   rL   rM   rN   rO   s                  rP   xla_split_ndr    s@   b 
			0h..0$#\\11lD%azHg n 3!	Ju	.
	%'1	23 3 ?II!!"l3I*IH	HtUm	,
	%'/	01 1 ;CCBhJ/C(C'88EQ:'d4!QX QK'""$3%%c*C1B1B31GCLL6
ll:&(F ::LlFG5	.G && -
##At,,## 
(
1hT  ## 
 J Ds<    F- H#)H(-G4 GG43G48H	 	H H zraw_ops.XlaSplitNDc                 L   t        j                  |d      }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}|g }t        |t        t        f      st        d|z        |D cg c]  }t        j                  |d       }}t        j                  | g|g       \  }\  } | g}d|d|d|d|f}	t        j                  d|||	||      }
t        j                         rt        j                  d	||	|
       |
S c c}w c c}w )
Nr   r  r  r  r   r2   s
   XlaSplitNDrT   r  )
r>   r?   r   r   r   r   rV   r   rB   rF   )r(   r   r  r   r0   r1   r   rm   rO   rN   rI   s              rP   r  r    sC   3!	Ju	.
	%'1	23 3 ?II!!"l3I*IH	HtUm	,
	%'/	01 1 ;CCBhJ/C(C55ugsBG'8E,#q,
J
&]Al#)s?'""$lFG5	.# J Ds   D
D!)N)r   r   FFTr   N)r   N)r   N)r   r   r   N)r   N)Fr   FN(%  __doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r3   r   r7   r   r>   tensorflow.python.frameworkr   rW   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r9   r   r@   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   	_dispatch tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   r   Int32intrQ   	to_raw_opr/   r<   ro   Resourcer   r}   r   r   r   r   r   strrk   Stringr   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	  r
  r  r  r  r  r  r  r)  r!  r(  r+  r,  r-  r:  r/  r9  r<  rE  r?  rB  rP  rI  rN  rR  rX  rT  rW  Variantr^  r\  r]  rg  rb  rf  Boolrn  rl  rm  Float32r{  rx  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  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  r  r  r  r  r  r
  r  
namedtupler  r  r  r  r  r!  r  r   r&  r(  r$  r'  r-  r/  r+  r.  r5  r7  r3  r6  r=  r?  r;  r>  rC  rE  rA  rD  rI  rK  rG  rJ  rO  rQ  rM  rP  rU  rW  rS  rV  r[  r]  rY  r\  ra  rc  r_  rb  rh  rf  rg  rq  rl  ro  rx  ru  rw  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  r  r  r}  rn   rP   <module>r     sEB  
  6 7 1 7 9 F K 3 I C 8 6 % % ');^Macv  yJ  L]  _m  o~  @O  Q`  bp  rB  DT  Ve  gx  zJ  L\  ^n  p@  BQ  RKi] 23 KyQTV]VcVcQcGd Kx{ K  OR K  ad K  t}  ~A  CP  ~P  tQ KZ )9'(
)CDYsM/A%B V_`celerer`rVs   HK   ^a   ps   CL  MP  R_  M_  C` $ ")  "`
  ce  lp [Ic7;K;K6K,L [V_`deh`i  lJ  aJ  WK [x KI&IJ>4>>ZwKxy 9S'JZJZEZ;[ enostwox  {Y  pY  fZ < !!9;MOcex  {L  N_  ao  q@  BQ  Sb  dr  tD  FV  Xg  iz  |L  N^  `p  rB  DS  T 0i-C(CD 0[dehjqjwjwew[x 0  IR  SV  Xn  Sn  Io 0d ;I9:>4>>J\;]^ Ys<R7R-S jstw  zA  zG  zG  uG  kH   Xa  be  g}  b}  X~ Xs XC Xcg X  OS X  |@ X  eh X  zC  DG  IP  IW  IW  DW  zX Xt G)$EF~t~~VoGpq  s  Z]  os    VZ    ~B    cf    v  @C  EL  ES  ES  @S  vT  F C  B C	"AB>4>>RiCjk 3  57IK\^oq  BQ  Sc  d 0Ys,@'@A 0U^_bdkdqdq_qUr 0  CL  MP  Rf  Mf  Cg 0d 7)56~t~~FW7XYIc;O6O,P dmnqsz  tA  tA  oA  eB   R[  \_  au  \u  Rv  8??u  xG  IX  8Y 47>?u  xG  IX  8Y 47>?u  xI  K\  8] 4 LN  UY qW`aefiaj  ma  ba  Xb q  w@  AE  FI  AJ  L@  A@  wA q  Xa  bf  gj  bk  ma  ba  Xb q  s|  }@  BI  BP  BP  }P  sQ q  cl  mp  ry  r  r  m  c@ qd 2u;s1t  vDuy  vD  vD  Ey  vz  2{ .+foptuxpy  |p  qp  gq +  FO  PT  UX  PY  [O  PO  FP +  gp  qu  vy  qz  |p  qp  gq +  BK  LO  QX  Q_  Q_  L_  B` +  r{  |  AH  AN  AN  |N  rO +\ 5<<o  rA  CR  5S 14;<o  rA  CR  5S 14;<o  rC  EV  5W 1 |~  UW  fh  os fYtTWy  [L  PL  FM f  bk  lp  qt  lu  wh  lh  bi f  @I  JN  OR  JS  UF  JF  @G f  Xa  be  gn  gu  gu  bu  Xv f  HQ  RU  W^  Wd  Wd  Rd  He fN /oi8m.no}oso}o}  p  pq  /r +?T]^bcf^g  j[  _[  U\ ?  qz  {  @C  {D  Fw  {w  qx ?  OX  Y]  ^a  Yb  dU  YU  OV ?  gp  qt  v}  vD  vD  qD  gE ?  W`  ad  fm  fs  fs  as  Wt ?D 188gix  {J  1K -078gix  {J  1K -078giz  }N  1O - IK  WY  `d uyY]^aYb  eR  ZR  PS u  hq  rv  wz  r{  }j  rj  hk u  BK  LP  QT  LU  WD  LD  BE u  V_  `c  el  es  es  `s  Vt u  EH ul +g)4e*fgugkgugu  wc  hd  +e '-^ghlmphq  ta  ia  _b -  w@  AE  FI  AJ  Ly  Ay  wz -  QZ  [_  `c  [d  fS  [S  QT -  en  or  t{  tB  tB  oB  eC -  UX -`4ycGMM9Q/R 4clmpry  sA  sA  nA  dB 4  SV 4j #W),U"VWeW[WeWe  gJ  XK  #L iS	SZS`S`H`>a r{|  BI  BP  BP  }P  sQ   cf ( .55acr  uD  .E *-45acr  uD  .E *-45act  wH  .I * y{  GI  `b  qs  z~ MYtCyR|G|=} M  S\  ]a  be  ]f  hR  ]R  SS M  js  tx  y|  t}  i  ti  jj M  {D  EH  JQ  JX  JX  EX  {Y M  ux M\ (ay1_'`aoaeaoao  qZ  b[  (\ $BIVZ[^V_  bL  WL  MM B  bk  lp  qt  lu  wa  la  bb B  yB  CG  HK  CL  Nx  Cx  yy B  JS  TW  Y`  Yg  Yg  Tg  Jh B  EH BJ (//UWfhw'x $'./UWfhw'x $'./UWhj{'| $ VX  df  mq jycLpAp7q j  GP  QU  VY  QZ  \@  Q@  GA j  Xa  bf  gj  bk  mQ  bQ  XR j  cl  mp  ry  r@  r@  m@  cA j  RU jV "U+S!TUcUYUcUc  eG  VH  "I -iPTUXPY[P  GA -  V_  `d  eh  `i  kO  `O  VP -  gp  qu  vy  qz  |`  q`  ga -  r{  |  AH  AO  AO  |O  rP -  be -` .55acr  uD  .E *-45acr  uD  .E *-45act  wH  .I * z|  HJ  ac  rt  { KiS	S}H}>~ K  T]  ^b  cf  ^g  iS  ^S  TT K  kt  uy  z}  u~  @j  uj  kk K  |E  FI  KR  KY  KY  FY  |Z K  vy KX (ay1_'`aoaeaoao  qZ  b[  (\ $BYW[\_W`  cM  XM  NN B  cl  mq  ru  mv  xb  mb  cc B  zC  DH  IL  DM  Oy  Dy  zz B  KT  UX  Za  Zh  Zh  Uh  Ki B  FI BJ !  P
 (0 (yQTVlQlGm (T 3	12>4>>.3QR)? V_`ce{`{V| 3j =Y;<^T^^L`=ab , !  P
 HJSUjlsw 8)C)?$?@ 8fi 8r 3	12>4>>.3QR38N3N)O ps 0'ygoo9M/N '_b 'P $Y9-W#XYgY]YgYg  iL  ZM  $N  iW__H\>] or  24QU ;C ;x =Y;<^T^^L`=ab QT 4' 'iW\\HY>Z 'R KI&IJ>4>>ZvKwx  9UXZaZfZfUfKg  C9S'//=Q3R C]fgjlsl{l{g{]| C  KT  UX  Za  Zi  Zi  Ui  Kj C  x{ C  GJ C  UX C  hk C  wz CH "U+S!TUcUYUcUc  eG  VH  "I )CQXQ`Q`L`Ba luvy  |C  |K  |K  wK  mL   Zc  dg  ip  ix  ix  dx  Zy   GJ   VY   eh   vy   CF 2CygooAU7V Cfopsu|  vE  vE  qE  gF C  QZ  [^  `g  `o  `o  [o  Qp C  ~A C  MP C  [^ C  nq C  }@ CH &]Y/[%\]k]a]k]k  mS  ^T  &U "iPSU\UdUdPdFe u~  @C  EL  ET  ET  @T  vU   `i  jm  ov  o~  o~  j~  `   MP   \_   kn   |   IL 2CygooI]?^ Cnwx{  ~E  ~M  ~M  yM  oN C  Yb  cf  ho  hw  hw  cw  Yx C  FI C  UX C  cf C  vy C  EH CH -kI6i,jkykokyky  {i  lj  -k )iX[]d]l]lXlNm   ~G  HK  MT  M\  M\  H\  ~]   hq  ru  w~  wF  wF  rF  hG   UX   dg   sv   DG   QT 2@iW__@T6U @enort{  uD  uD  pD  fE @  SV @  be @  ps @  CF @  RU @B %[I.Y$Z[i[_[i[i  kP  \Q  %R !YsT[TcTcOcEd t}  B  DK  DS  DS  S  uT   be   qt   @C   QT   ^a 0D	#wJ^@_ Denort{  uD  uD  pD  fE D  LU  VY  [b  [j  [j  Vj  Lk D  qz  {~  @G  @O  @O  {O  qP D  ^a D  mp D  {~ D  NQ D  ]` DJ -kI6i,jkykokyky  {j  lk  -l )yY\^e^m^mYmOn t}  B  DK  DS  DS  S  uT   [d  eh  jq  jy  jy  ey  [z   @I  JM  OV  O^  O^  J^  @_   mp   |   KN   \_   il 4C9S'//=Q3R Cbkloqx  rA  rA  mA  cB C  MV  WZ  \c  \k  \k  Wk  Ml C  z} C  IL C  WZ C  jm C  y| CH "U+S!TUcUYUcUc  eG  VH  "I )CQXQ`Q`L`Ba qz{~  AH  AP  AP  |P  rQ   \e  fi  kr  kz  kz  fz  \{   IL   X[   gj   x{   EH 2B)CQXQ`Q`L`Ba Br{|  BI  BQ  BQ  }Q  sR B  `c B  or B  }@ B  PS B  _b BF 0qy9o/pqquqq  Ar  rs  0t ,QZ[^`g`o`o[oQp   BK  LO  QX  Q`  Q`  L`  Ba   or   ~A   MP   ^a   kn 0G	#wJ^@_ Goxy|  F  N  N  zN  pO G  Zc  dg  ip  ix  ix  dx  Zy G  EN  OR  T[  Tc  Tc  Oc  Ed G  ru G  AD G  OR G  be G  qt GP -kI6i,jkykokyky  {j  lk  -l )yY\^e^m^mYmOn   H  IL  NU  N]  N]  I]  ^   ir  sv  x  xG  xG  sG  iH   T]  ^a  cj  cr  cr  ^r  Ts   AD   PS   _b   ps   }@ 4@ygooAU7V @ajknpwppk  bA @  OR @  ^a @  lo @  B @  NQ @B &]Y/[%\]k]a]k]k  mS  ^T  &U "iPSU\UdUdPdFe pyz}  @G  @O  @O  {O  qP   ^a   mp   |   MP   Z] 0@ygooI]?^ @nwx{  ~E  ~M  ~M  yM  oN @  \_ @  kn @  y| @  LO @  [^ @B -kI6i,jkykokyky  {i  lj  -k )iX[]d]l]lXlNm   ~G  HK  MT  M\  M\  H\  ~]   kn   z}   IL   Z]   gj 08Ic7??FZ<[ 8`ijmovo~o~j~` 8  EN  OR  T[  Tc  Tc  Oc  Ed 8  ru 8  AD 8  OR 8  be 8  qt 8r *e3c)deseieses  u`  fa  *b &9UXZaZiZiUiKj oxy|  F  N  N  zN  pO   T]  ^a  cj  cr  cr  ^r  Ts   AD   PS   _b   ps   }@ 2AygooAU7V A\efikrkzkzfz\{ A  CL  MP  RY  Ra  Ra  Ma  Cb A  ps A  B A  MP A  `c A  or AD %[I.Y$Z[i[_[i[i  kQ  \R  %S !iPSU\UdUdPdFe ktux  {B  {J  {J  vJ  lK   R[  \_  ah  ap  ap  \p  Rq   B   NQ   ]`   nq   {~ 2>)TWY`YhYhThJi >wz >  GJ >  UX >  hk >  wz >~ 7i@}6~  @N  @D  @N  @N  OH  @I  7J 3YbcfhohwhwcwYx   GJ   VY   eh   vy   CF . "  R
 52 5# 5`ijm  pG  kG  aH 5n 534^T^^O5TU*A Z] mvwz  }T  xT  nU "A AF ?i =>~t~~Nc?de  4=YsGMM7I-J =~ C	"AB>4>>RjCkl Ic7==FX<Y . $  V
 1ygmm1C'D 1Mf 1  ~G  HK  Mf  Hf  ~g 1f 9978HZ9[\ iW]]@R6S \u   MV  WZ  \u  Wu  Mv  "  R
 9S*A%AB < 534^T^^O5TU)C9P4P*Q @ ?i =>~t~~Nc?de     N
 EGPRY] 5	#'<"<= 5bkloqx  rA  rA  mA  cB 5n 1y/01MNy6K1K'L ktux  {B  {J  {J  vJ  lK . 02 ;3PWP_P_K_A` ;z ;I9:>4>>J\;]^ YWZ\c\k\kWkMl 2 &  Z
  IK  RV b38H8H3H)I bNi bnq bH E#CD^T^^TnEop 	#wGWGWBW8X ]x   ~A 64 4S 4l Oi(MN~t~~^|O}~ s C  -CK,B,B(+-- )
Gs Gc GTW Ggj Gvy GR &]Y/[%\]k]a]k]k  mS  ^T  &U "c UX dg ux   CF 0 1G0F0F,-1/ -
G3 G# GX[ Gkn Gz} GR *e3c)deseieses  u_  f`  *a &# Y\ hk y|   GJ 0 8N{7M7M3-8/ 4
H3 HRU H`c Hsv H  CF HT 1s	:q0r  tBsw  tB  tB  Cu  tv  1w -RU ad ps   BE   OR 0 0F{/E/E+>"0$ ,
F# F FWZ Fjm Fy| FP )c	2a(bcqcgcqcq  s\  d]  )^ % X[ gj x{   FI 0 8N{7M7M3%8' 4
IC ISV Iad Itw I  DG IV 1s	:q0r  tBsw  tB  tB  Cv  tw  1x -SV be qt   CF   PS 0 -CK,B,B(--/ )
Gs Gc GTW Ggj Gvy GR &]Y/[%\]k]a]k]k  mS  ^T  &U "c UX dg ux   CF 0 ;Q+:P:P6?#;% 7
Gc GUX Gcf Gvy G  FI GR 4y9=w3x  zHy}  zH  zH  I~  z  4@ 0UX dg sv   EH   RU 0 8N{7M7M398; 4
IC ISV Iad Itw I  DG IV 1s	:q0r  tBsw  tB  tB  Cv  tw  1x -SV be qt   CF   PS 0 1G0F0F,91 -
F3 F# FX[ Fkn Fz} FP *e3c)deseieses  u_  f`  *a &# Y\ hk y|   GJ 0 8N{7M7M3>"8$ 4
G3 GRU G`c Gsv G  CF GR 1s	:q0r  tBsw  tB  tB  Cu  tv  1w -RU ad ps   BE   OR 0 5KK4J4J05 1
C Cs C]` Cps C  @C CJ .mY7k-lm{mqm{m{  }l  nm  .n *s ^a mp   B   LO 0 0F{/E/E+0! ,
G3 G# GX[ Gkn Gz} GR )c	2a(bcqcgcqcq  s]  d^  )_ %# Y\ hk y|   GJ 2Cc C]` Ckn C  B C  NQ C  dm  nq  sz  sB  sB  nB  dC CJ ;G)  EF  ;G  HV  HL  HV  HV  WT  HU  ;V 7]` lo {~   MP   Z]   mv  wz  |C  |K  |K  wK  mL 2949goo3M)N 9`ijnorjsu|  vE  vE  kE  aF 9  PS 9t KI&IJ>4>>ZvKwx 	$s)W__B\8] oxy}  B  zC  EL  ET  ET  zT  pU   _b .> E#CD^T^^TlEmn '33F)G 'R Ay!?@PfAgh 		#w~~BU8V 	;)C<P2Q ;gpqtv}  wF  wF  rF  hG ;  SV ;  cf ;  v  @C  EL  ET  ET  @T  vU ;z G)$EF~t~~VoGpq 3PWP_P_K_A` v  AD  FM  FU  FU  AU  wV   be   ru   EN  OR  T[  Tc  Tc  Oc  Ed "'ygmm1C'D 'R =Y;<^T^^L`=ab 	iW]]@R6S 	6ygmm9K/L 6hk 6p =Y;<^T^^L`=ab iW]]HZ>[ x{ . IJXZim  BD  XZ  np  ~@  [o  KP  uz  Z\  cg } }C }TW }dh }  WZ }  FJ }  pt }  VY }| Ay!?@PfAgh ? ?TW ?cf ?qu ?  TW ?  os ?  TX ?  ux ?D "  R
 I496M+M!N Iei Iwz I  JN I  dm  nq  sJ  nJ  dK IV =Y;<^T^^L`=ab 	$s)E\:\0] uy   CF   SW   gp  qt  vM  qM  gN 8 #  T
 230H+H!I 2Y\ 2h ?i =>~t~~Nc?de 	#?W:W0X hk (iW^^(;< (IVY[b[i[iViLj (T 7)56~t~~FV7WX
YsGNN7J-K 
[dehjqjxjxex[y 
   D
 XZae a)DI/?$?@ ajstw  zJ  uJ  kK aF /i-.~t~~m/LM49>N3N)O v  AD  FV  AV  wW >   B
VX_c \	#"67 \C \| -Y+,^T^^L-IJ
yo1E'F 3 rn   