
    AVh                    X.   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 Z$dde#e!ejJ                  f   de#e!e$f   de#e!ejJ                  f   de&de&de#e!ejJ                  f   fdZ'  ed       ejP                  e'            Z)de#e!ejJ                  f   de#e!e$f   de#e!ejJ                  f   de&de&de#e!ejJ                  f   fdZ* ed Z+dde#e!ejJ                  f   de#e!e+f   de#e!ejJ                  f   de&de&de#e!ejJ                  f   fdZ,  ed       ejP                  e,            Z-de#e!ejJ                  f   de#e!e+f   de#e!ejJ                  f   de&de&de#e!ejJ                  f   fdZ. ej^                  dg d       Z0 ed! Z1dd"e#e!ejd                  f   d#e1fd$Z3  ed%       ejP                  e3            Z4d"e#e!ejd                  f   d#e1fd&Z5 ej^                  d'g d       Z6 ed( Z7 ed)d*d+      Z8dd"e#e!e8f   d#e7fd,Z9  ed-       ejP                  e9            Z:d"e#e!e8f   d#e7fd.Z; ed/ Z< ed0d*d+      Z=ej|                  dfde#e!ejJ                  f   de#e!e<f   de#e!ejJ                  f   d1e=de#e!e=f   f
d2Z?  ed3       ejP                  e?            Z@de#e!ejJ                  f   de#e!e<f   de#e!ejJ                  f   d1e=de#e!e=f   f
d4ZA ed5 ZB ed6d*d+      ZCej|                  dfde#e!ejJ                  f   de#e!eBf   de#e!ejJ                  f   d1eCde#e!eCf   f
d7ZD  ed8       ejP                  eD            ZEde#e!ejJ                  f   de#e!eBf   de#e!ejJ                  f   d1eCde#e!eCf   f
d9ZF ej^                  d:g d;      ZG ed<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      ZH edPd=d@dAdBdCdDdEdFdLdMdNdO      ZIddQe#e!ejJ                  f   dRe#e!eHf   dSe#e!ejJ                  f   dTe#e!ejJ                  f   dUe#e!eHf   dVe#e!ejJ                  f   dWe#e!eIf   fdXZJ  edY       ejP                  eJ            ZKdQe#e!ejJ                  f   dRe#e!eHf   dSe#e!ejJ                  f   dTe#e!ejJ                  f   dUe#e!eHf   dVe#e!ejJ                  f   dWe#e!eIf   fdZZL ej^                  d[d\d]g      ZM ed^d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      ZNdd_e#e!eNf   dQe#e!ejJ                  f   dTe#e!ejJ                  f   d`e#e!ejJ                  f   fdaZO  edb       ejP                  eO            ZPd_e#e!eNf   dQe#e!ejJ                  f   dTe#e!ejJ                  f   d`e#e!ejJ                  f   fdcZQ ej^                  ddg de      ZR edf ZSddge#e e!   ejJ                  f   dhe#e e!   eSf   die#e e!   ejJ                  f   djeTfdkZU  edl       ejP                  eU            ZVdge#e e!   ejJ                  f   dhe#e e!   eSf   die#e e!   ejJ                  f   djeTfdmZW ej^                  dng de      ZX edodEd*      ZY edpdEd*      ZZddge#e e!   ejJ                  f   die#e e!   ejJ                  f   dqe[dreTdseTd1eYdteZfduZ\  edv       ejP                  e\            Z]dge#e e!   ejJ                  f   die#e e!   ejJ                  f   dqe[dreTdseTd1eYdteZfdwZ^ ej^                  dxg de      Z_ddge#e e!   ejJ                  f   die#e e!   ejJ                  f   dre#e!ejJ                  f   dye#e!ej                  f   dze#e!ejJ                  f   f
d{Za  ed|       ejP                  ea            Zbdge#e e!   ejJ                  f   die#e e!   ejJ                  f   dre#e!ejJ                  f   dye#e!ej                  f   dze#e!ejJ                  f   f
d}Zc ej^                  d~g de      Zdddge#e e!   ejJ                  f   die#e e!   ejJ                  f   de#e!ejd                  f   fdZe  ed       ejP                  ee            Zfdge#e e!   ejJ                  f   die#e e!   ejJ                  f   de#e!ejd                  f   fdZg edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Zhdde#e!ejJ                  f   de#e!ehf   de#e!ejJ                  f   de#e!ehf   de#e!ehf   f
dZi  ed       ejP                  ei            Zjde#e!ejJ                  f   de#e!ehf   de#e!ejJ                  f   de#e!ehf   de#e!ehf   f
dZk edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Zldde#e!ejJ                  f   de#e!elf   de#e!ejJ                  f   de#e!elf   de#e!elf   f
dZm  ed       ejP                  em            Znde#e!ejJ                  f   de#e!elf   de#e!ejJ                  f   de#e!elf   de#e!elf   f
dZo edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Zpdde#e!ejJ                  f   de#e!epf   de#e!ejJ                  f   de#e!epf   de#e!epf   f
dZq  ed       ejP                  eq            Zrde#e!ejJ                  f   de#e!epf   de#e!ejJ                  f   de#e!epf   de#e!epf   f
dZs ej^                  dg d      Zt ed Zuddge#e!ejJ                  f   dhe#e!euf   de#e!ejJ                  f   de#e!euf   fdZv  ed       ejP                  ev            Zwdge#e!ejJ                  f   dhe#e!euf   de#e!ejJ                  f   de#e!euf   fdZx ej^                  dddg      Zy ed Zzdde#e!ejJ                  f   de#e!ezf   fdZ{  ed       ejP                  e{            Z|de#e!ejJ                  f   de#e!ezf   fdZ} edd=d@dAdBdCdDdEdFdLdMdNdO      Z~dde#e!ejJ                  f   de#e!e~f   de#e!ejJ                  f   de#e!ej                  f   de[de#e!e~f   fdZ  ed       ejP                  e            Zde#e!ejJ                  f   de#e!e~f   de#e!ejJ                  f   de#e!ej                  f   de[de#e!e~f   fdZ ej^                  dg de      Z edd=d@dAdBdCdDdEdFdLdMdNdO      Zdde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ej                  f   de[f
dZ  ed       ejP                  e            Zde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ej                  f   de[f
dZ edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Zdde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ej                  f   de[de#e!ef   fdZ  ed       ejP                  e            Zde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ej                  f   de[de#e!ef   fdZ ej^                  dg de      Z edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Zdde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ej                  f   de[f
dZ  ed       ejP                  e            Zde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ej                  f   de[f
dZ ej^                  dddg      Z ed Zdde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   fdZ  ed       ejP                  e            Zde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   fdZ ej^                  dddg      Zdde#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   fdńZ  edƫ       ejP                  e            Zde#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   fdǄZ ej^                  dg de      Z edɎ Zddge#e!ejJ                  f   dhe#e!ef   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   f
d̈́Z  edΫ       ejP                  e            Zdge#e!ejJ                  f   dhe#e!ef   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   f
dτZ edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Zdd_e#e!ef   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ef   f
d҄Z  edӫ       ejP                  e            Zd_e#e!ef   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ef   f
dԄZ edd@dAdB      Zdde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ef   fdքZ  ed׫       ejP                  e            Zde#e!ejJ                  f   de#e!ef   de#e!ejJ                  f   de#e!ef   fd؄Z ej^                  dddg      Z edd=d@dAdBdCdDdEdFdLdMdNdO      ZddQe#e!ejJ                  f   dRe#e!ef   dSe#e!ejJ                  f   dTe#e!ejJ                  f   dUe#e!ef   dVe#e!ejJ                  f   fdۄZ  edܫ       ejP                  e            ZdQe#e!ejJ                  f   dRe#e!ef   dSe#e!ejJ                  f   dTe#e!ejJ                  f   dUe#e!ef   dVe#e!ejJ                  f   fd݄Z ej^                  dddg      Z edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      ZddQe#e!ejJ                  f   dRe#e!ef   dSe#e!ejJ                  f   dTe#e!ejJ                  f   dUe#e!ef   dVe#e!ejJ                  f   fdZ  ed       ejP                  e            ZdQe#e!ejJ                  f   dRe#e!ef   dSe#e!ejJ                  f   dTe#e!ejJ                  f   dUe#e!ef   dVe#e!ejJ                  f   fdZ ej^                  dg de      Z ed Zdde#e!ejJ                  f   dge#e!ejJ                  f   dhe#e!ef   de#e!ejJ                  f   deTf
dZ  ed       ejP                  e            Zde#e!ejJ                  f   dge#e!ejJ                  f   dhe#e!ef   de#e!ejJ                  f   deTf
dZ edd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdO      Z eddDdE      ZddQe#e!ef   dRe#e!ef   dSe#e!ef   de#e!ef   de#e!ef   f
dZ  ed       ejP                  e            ZdQe#e!ef   dRe#e!ef   dSe#e!ef   de#e!ef   de#e!ef   f
dZ ed Z eddDdE      ZddQe#e!ef   dRe#e!ef   dSe#e!ejJ                  f   de#e!ef   de[de[de#e!ef   fdZ  ed       ejP                  e            ZdQe#e!ef   dRe#e!ef   dSe#e!ejJ                  f   de#e!ef   de[de[de#e!ef   fdZ ed Z eddDdE      Zdde#e!ef   de#e!ef   de#e!ef   de#e!ef   de[de#e!ef   fdZ  ed       ejP                  e«            Zde#e!ef   de#e!ef   de#e!ef   de#e!ef   de[de#e!ef   fdZ ej^                  dg d       Z ed ZƐdde#e!ejJ                  f   d#ede&de&fd Z  ed       ejP                  eǫ            Zde#e!ejJ                  f   d#ede&de&fdZy(  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_AddManySparseToTensorsMap_T_atypes.BFloat16_atypes.Bool_atypes.Complex128_atypes.Complex64_atypes.Float16_atypes.Float32_atypes.Float64_atypes.Float8e4m3b11fnuz_atypes.Float8e4m3fn_atypes.Float8e4m3fnuz_atypes.Float8e5m2_atypes.Float8e5m2fnuz_atypes.Half_atypes.Int16_atypes.Int32_atypes.Int4_atypes.Int64_atypes.Int8_atypes.QInt16_atypes.QInt32_atypes.QInt8_atypes.QUInt16_atypes.QUInt8_atypes.Resource_atypes.String_atypes.UInt16_atypes.UInt32_atypes.UInt4_atypes.UInt64_atypes.UInt8_atypes.Variantsparse_indicessparse_valuessparse_shape	containershared_namereturnc                 H   t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| ||d|d|
      }|S |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        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)	ap  Add an `N`-minibatch `SparseTensor` to a `SparseTensorsMap`, return `N` handles.

  A `SparseTensor` of rank `R` is represented by three tensors: `sparse_indices`,
  `sparse_values`, and `sparse_shape`, where

  ```sparse_indices.shape[1] == sparse_shape.shape[0] == R```

  An `N`-minibatch of `SparseTensor` objects is represented as a `SparseTensor`
  having a first `sparse_indices` column taking values between `[0, N)`, where
  the minibatch size `N == sparse_shape[0]`.

  The input `SparseTensor` must have rank `R` greater than 1, and the first
  dimension is treated as the minibatch dimension.  Elements of the `SparseTensor`
  must be sorted in increasing order of this first dimension.  The stored
  `SparseTensor` objects pointed to by each row of the output `sparse_handles`
  will have rank `R-1`.

  The `SparseTensor` values can then be read out as part of a minibatch by passing
  the given keys as vector elements to `TakeManySparseFromTensorsMap`.  To ensure
  the correct `SparseTensorsMap` is accessed, ensure that the same
  `container` and `shared_name` are passed to that Op.  If no `shared_name`
  is provided here, instead use the *name* of the Operation created by calling
  `AddManySparseToTensorsMap` as the `shared_name` passed to
  `TakeManySparseFromTensorsMap`.  Ensure the Operations are colocated.

  Args:
    sparse_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the minibatch `SparseTensor`.
      `sparse_indices[:, 0]` must be ordered values in `[0, N)`.
    sparse_values: A `Tensor`.
      1-D.  The `values` of the minibatch `SparseTensor`.
    sparse_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the minibatch `SparseTensor`.
      The minibatch size `N == sparse_shape[0]`.
    container: An optional `string`. Defaults to `""`.
      The container name for the `SparseTensorsMap` created by this op.
    shared_name: An optional `string`. Defaults to `""`.
      The shared name for the `SparseTensorsMap` created by this op.
      If blank, the new Operation's unique name is used.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `int64`.
  AddManySparseToTensorsMapr6   r7   Nr6   r7   namectx r3   r4   r5   r6   r7   r<   T)_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackException-add_many_sparse_to_tensors_map_eager_fallback_SymbolicException_executemake_str_op_def_library_apply_op_helpermust_record_gradient_get_attr_typeget_attrinputsrecord_gradientr3   r4   r5   r6   r7   r<   _ctxtld_resulte__op_outputs_attrs_inputs_flats                  T/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_sparse_ops.pyadd_many_sparse_to_tensors_mapr`      s   Z 
			0h..0$#\\	11)4|[)]g n I	;7)K!!+}=+'88#N3@2>/81<4I!QX QK'""$3%%c*Kll;'ll=)+F ::L#\67D('	.A && -
##At,,## 
:
-!$8 8 ## 
0    D- -E4 EE43E48F
 
F! F!z!raw_ops.AddManySparseToTensorsMapc                    |d}t        j                  |d      }|d}t        j                  |d      }t        j                  |g|g       \  }\  }t        j                  | t
        j                        } t        j                  |t
        j                        }| ||g}d|d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       |
\  }
|
S )	Nr>   r6   r7   r@   s   AddManySparseToTensorsMap   rS   attrsr=   r<   r:   
rL   rM   args_to_matching_eagerrG   convert_to_tensor_dtypesint64r   rP   rT   r3   r4   r5   r6   r7   r<   r=   _attr_Tr^   r]   rX   s              r_   rJ   rJ   v   s    I	;7)K!!+}=+&==}osTVW'M)).'--H.''gmmD, ->,+y-M&91$0C"&(' ""$#\67D('	.    ) TV_AddSparseToTensorsMap_Tr   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/   r0   r1   r2   c                 H   t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| ||d|d|
      }|S |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        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+  Add a `SparseTensor` to a `SparseTensorsMap` return its handle.

  A `SparseTensor` is represented by three tensors: `sparse_indices`,
  `sparse_values`, and `sparse_shape`.

  This operator takes the given `SparseTensor` and adds it to a container
  object (a `SparseTensorsMap`).  A unique key within this container is generated
  in the form of an `int64`, and this is the value that is returned.

  The `SparseTensor` can then be read out as part of a minibatch by passing
  the key as a vector element to `TakeManySparseFromTensorsMap`.  To ensure
  the correct `SparseTensorsMap` is accessed, ensure that the same
  `container` and `shared_name` are passed to that Op.  If no `shared_name`
  is provided here, instead use the *name* of the Operation created by calling
  `AddSparseToTensorsMap` as the `shared_name` passed to
  `TakeManySparseFromTensorsMap`.  Ensure the Operations are colocated.

  Args:
    sparse_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the `SparseTensor`.
    sparse_values: A `Tensor`. 1-D.  The `values` of the `SparseTensor`.
    sparse_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the `SparseTensor`.
    container: An optional `string`. Defaults to `""`.
      The container name for the `SparseTensorsMap` created by this op.
    shared_name: An optional `string`. Defaults to `""`.
      The shared name for the `SparseTensorsMap` created by this op.
      If blank, the new Operation's unique name is used.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `int64`.
  AddSparseToTensorsMapr6   r7   Nr;   r>   r?   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   (add_sparse_to_tensors_map_eager_fallbackrK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   s                  r_   add_sparse_to_tensors_maprr      s   D 
			0h..0$#\\11%t^]k9m[Jg n I	;7)K!!+}=+'88/<.:+4+&*,!QX QK'""$3%%c*Kll;'ll=)+F ::Lvw@('	.A && -
##At,,## 
5
-!$8 8 ## 
ra   zraw_ops.AddSparseToTensorsMapc                    |d}t        j                  |d      }|d}t        j                  |d      }t        j                  |g|g       \  }\  }t        j                  | t
        j                        } t        j                  |t
        j                        }| ||g}d|d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       |
\  }
|
S )	Nr>   r6   r7   r@   s   AddSparseToTensorsMaprc   rd   rp   rf   rk   s              r_   rq   rq      s    I	;7)K!!+}=+&==}osTVW'M)).'--H.''gmmD, ->,+y-M&5q#)s?'""$vw@('	.rm   DeserializeManySparse)r3   r4   r5   ) TV_DeserializeManySparse_dtyper   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/   r0   r1   r2   serialized_sparsedtypec                     t         j                   xs t        j                         }|j                  }|j                  r2	 t	        j
                  |d|| d|      }t        j                  |      }|S t        j                   |d      }t#        j$                  d| ||      \  }}}}	|	dd }t        j&                         r7d|j)                  d      f}
|j*                  }t        j,                  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  Deserialize and concatenate `SparseTensors` from a serialized minibatch.

  The input `serialized_sparse` must be a string matrix of shape `[N x 3]` where
  `N` is the minibatch size and the rows correspond to packed outputs of
  `SerializeSparse`.  The ranks of the original `SparseTensor` objects
  must all match.  When the final `SparseTensor` is created, it has rank one
  higher than the ranks of the incoming `SparseTensor` objects
  (they have been concatenated along a new row dimension).

  The output `SparseTensor` object's shape values for all dimensions but the
  first are the max across the input `SparseTensor` objects' shape values
  for the corresponding dimensions.  Its first shape value is `N`, the minibatch
  size.

  The input `SparseTensor` objects' indices are assumed ordered in
  standard lexicographic order.  If this is not the case, after this
  step run `SparseReorder` to restore index ordering.

  For example, if the serialized input is a `[2 x 3]` matrix representing two
  original `SparseTensor` objects:

      index = [ 0]
              [10]
              [20]
      values = [1, 2, 3]
      shape = [50]

  and

      index = [ 2]
              [10]
      values = [4, 5]
      shape = [30]

  then the final deserialized `SparseTensor` will be:

      index = [0  0]
              [0 10]
              [0 20]
              [1  2]
              [1 10]
      values = [1, 2, 3, 4, 5]
      shape = [2 50]

  Args:
    serialized_sparse: A `Tensor` of type `string`.
      2-D, The `N` serialized `SparseTensor` objects.
      Must have 3 columns.
    dtype: A `tf.DType`. The `dtype` of the serialized `SparseTensor` objects.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (sparse_indices, sparse_values, sparse_shape).

    sparse_indices: A `Tensor` of type `int64`.
    sparse_values: A `Tensor` of type `dtype`.
    sparse_shape: A `Tensor` of type `int64`.
  rt   rw   Nrw   r<   r=   rv   rw   r<   )rA   r   rB   rC   r   rD   _DeserializeManySparseOutput_makerE   rF   rG   rH   rI   &deserialize_many_sparse_eager_fallbackrK   rL   	make_typerN   rO   rP   rQ   rS   rT   rv   rw   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s               r_   deserialize_many_sparser      su   v 
			0h..0$#\\	11%t->g -227;gn 

UG
,%'883D',49!QX QK'""$s))'23F::Lvw@(..w7'	.+ && -
##At,,## 
3
5t? ?## 
s0    0D ED::EEE& &E=<E=zraw_ops.DeserializeManySparsec                 @   t        j                  |d      }t        j                  | t        j
                        } | g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nrw   s   DeserializeManySparse   rd   rt   )rL   r~   rG   rh   ri   stringr   rP   rT   r{   r|   )rv   rw   r<   r=   r^   r]   rX   s          r_   r}   r}   V  s    


UG
,%,,->O#$,U&5q#)s?'""$vw@(..w7'	.rm   DeserializeSparse) TV_DeserializeSparse_dtyper   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/   r0   r1   r2    TV_DeserializeSparse_Tserializedr,   r2   c                 "   t         j                   xs t        j                         }|j                  }|j                  r2	 t	        j
                  |d|| d|      }t        j                  |      }|S t        j                   |d      }t#        j$                  d| ||      \  }}}}	|	dd }t        j&                         rHd|j)                  d      d|j)                  d      f}
|j*                  }t        j,                  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  Deserialize `SparseTensor` objects.

  The input `serialized_sparse` must have the shape `[?, ?, ..., ?, 3]` where
  the last dimension stores serialized `SparseTensor` objects and the other N
  dimensions (N >= 0) correspond to a batch. The ranks of the original
  `SparseTensor` objects must all match. When the final `SparseTensor` is
  created, its rank is the rank of the incoming `SparseTensor` objects plus N;
  the sparse tensors have been concatenated along new dimensions, one for each
  batch.

  The output `SparseTensor` object's shape values for the original dimensions
  are the max across the input `SparseTensor` objects' shape values for the
  corresponding dimensions. The new dimensions match the size of the batch.

  The input `SparseTensor` objects' indices are assumed ordered in
  standard lexicographic order.  If this is not the case, after this
  step run `SparseReorder` to restore index ordering.

  For example, if the serialized input is a `[2 x 3]` matrix representing two
  original `SparseTensor` objects:

      index = [ 0]
              [10]
              [20]
      values = [1, 2, 3]
      shape = [50]

  and

      index = [ 2]
              [10]
      values = [4, 5]
      shape = [30]

  then the final deserialized `SparseTensor` will be:

      index = [0  0]
              [0 10]
              [0 20]
              [1  2]
              [1 10]
      values = [1, 2, 3, 4, 5]
      shape = [2 50]

  Args:
    serialized_sparse: A `Tensor`. Must be one of the following types: `string`, `variant`.
      The serialized `SparseTensor` objects. The last dimension
      must have 3 columns.
    dtype: A `tf.DType`. The `dtype` of the serialized `SparseTensor` objects.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (sparse_indices, sparse_values, sparse_shape).

    sparse_indices: A `Tensor` of type `int64`.
    sparse_values: A `Tensor` of type `dtype`.
    sparse_shape: A `Tensor` of type `int64`.
  r   rw   Nry   rz   Tserialized)rA   r   rB   rC   r   rD   _DeserializeSparseOutputr|   rE   rF   rG   rH   rI   !deserialize_sparse_eager_fallbackrK   rL   r~   rN   rO   rP   rQ   rS   rT   r   s               r_   deserialize_sparser   k  s   v 
			0h..0$#\\11!4):GULg(..w7gn 

UG
,%'88/@"&(!QX QK'""$s))'2M  /1F::L\67<$**73'	.- && -
##At,,## 
.
5t? ?## 
s0    0D E$0EE$#E$(E7 7FFzraw_ops.DeserializeSparsec                    t        j                  |d      }t        j                  | g|t        j                  t        j
                  gt        j                        \  }\  } | g}d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nrw   r   s   DeserializeSparser   rd   r   )rL   r~   rg   ri   r   variantr   rP   rT   r   r|   )rv   rw   r<   r=   _attr_Tserializedr^   r]   rX   s           r_   r   r     s    


UG
,%,4,K,KM^L_adgnguguw~  xG  xG  gJ  LS  LZ  LZ  -[))'#$,UM+<=&11\#)s?'""$\67<$**73'	.rm   ) TV_SerializeManySparse_Tr   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/   r0   r1   r2   TV_SerializeManySparse_out_typeout_typec           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||d|      }|S |t        j                  }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,  Serialize an `N`-minibatch `SparseTensor` into an `[N, 3]` `Tensor` object.

  The `SparseTensor` must have rank `R` greater than 1, and the first dimension
  is treated as the minibatch dimension.  Elements of the `SparseTensor`
  must be sorted in increasing order of this first dimension.  The serialized
  `SparseTensor` objects going into each row of `serialized_sparse` will have
  rank `R-1`.

  The minibatch size `N` is extracted from `sparse_shape[0]`.

  Args:
    sparse_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the minibatch `SparseTensor`.
    sparse_values: A `Tensor`.
      1-D.  The `values` of the minibatch `SparseTensor`.
    sparse_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the minibatch `SparseTensor`.
    out_type: An optional `tf.DType` from: `tf.string, tf.variant`. Defaults to `tf.string`.
      The `dtype` to use for serialization; the supported types are `string`
      (default) and `variant`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `out_type`.
  SerializeManySparser   Nr   r<   r=   r3   r4   r5   r   r<   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   $serialize_many_sparse_eager_fallbackrK   ri   r   rL   r~   rN   rO   rP   rQ   rS   rT   r3   r4   r5   r   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   serialize_many_sparser     s   4 
			0h..0$#\\11#T>=j(,g n ~~H*5('88n-:,88$(	*!QX
 QK'""$3%%c*J  ,.F::L|VW>('	.7 && -
##At,,## 
1
-  ## 
0    D E D;;EEE) )F ?F zraw_ops.SerializeManySparsec                    |t         j                  }t        j                  |d      }t        j                  |g|g       \  }\  }t        j                  | t         j                        } t        j                  |t         j                        }| ||g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Nr   r@   s   SerializeManySparserc   rd   r   ri   r   rL   r~   rg   rG   rh   rj   r   rP   rT   
r3   r4   r5   r   r<   r=   rl   r^   r]   rX   s
             r_   r   r     s    ~~H*5(&==}osTVW'M)).'--H.''gmmD, ->,*h/&3Q|#)s?'""$|VW>('	.rm   ) TV_SerializeSparse_Tr   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/   r0   r1   r2   TV_SerializeSparse_out_typec           
         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| ||d|      }|S |t        j                  }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)ar  Serialize a `SparseTensor` into a `[3]` `Tensor` object.

  Args:
    sparse_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the `SparseTensor`.
    sparse_values: A `Tensor`. 1-D.  The `values` of the `SparseTensor`.
    sparse_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the `SparseTensor`.
    out_type: An optional `tf.DType` from: `tf.string, tf.variant`. Defaults to `tf.string`.
      The `dtype` to use for serialization; the supported types are `string`
      (default) and `variant`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `out_type`.
  SerializeSparser   Nr   r   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   serialize_sparse_eager_fallbackrK   ri   r   rL   r~   rN   rO   rP   rQ   rS   rT   r   s                 r_   serialize_sparser   1  s   " 
			0h..0$#\\11~}j(,g n ~~H*5('88.)6(4x $	&!QX
 QK'""$3%%c*J  ,.F::L<:('	.7 && -
##At,,## 
,
-  ## 
r   zraw_ops.SerializeSparsec                    |t         j                  }t        j                  |d      }t        j                  |g|g       \  }\  }t        j                  | t         j                        } t        j                  |t         j                        }| ||g}d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d|||	       |	\  }	|	S )Nr   r@   s   SerializeSparserc   rd   r   r   r   s
             r_   r   r   j  s    ~~H*5(&==}osTVW'M)).'--H.''gmmD, ->,*h/&/<#)s?'""$<:('	.rm   	SparseAdd)sum_indices
sum_values	sum_shapeTV_SparseAdd_Tr   r   r   r   r   r    r!   r"   r$   r%   r&   r'   r(   r)   r*   r-   r.   r0   r1   TV_SparseAdd_Treal	a_indicesa_valuesa_shape	b_indicesb_valuesb_shapethreshc                    t         j                   xs t        j                         }|j                  }	|	j                  r6	 t	        j
                  |d|| ||||||
      }
t        j                  |
      }
|
S t        j                   d| |||||||	      \  }}}}|dd }
t#        j$                         rHd|j'                  d      d|j'                  d      f}|j(                  }t#        j*                  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)aK	  Adds two `SparseTensor` objects to produce another `SparseTensor`.

  The input `SparseTensor` objects' indices are assumed ordered in standard
  lexicographic order.  If this is not the case, before this step run
  `SparseReorder` to restore index ordering.

  By default, if two values sum to zero at some index, the output `SparseTensor`
  would still include that particular location in its index, storing a zero in the
  corresponding value slot.  To override this, callers can specify `thresh`,
  indicating that if the sum has a magnitude strictly smaller than `thresh`, its
  corresponding value and index would then not be included.  In particular,
  `thresh == 0` (default) means everything is kept and actual thresholding happens
  only for a positive value.

  In the following shapes, `nnz` is the count after taking `thresh` into account.

  Args:
    a_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the first `SparseTensor`, size `[nnz, ndims]` Matrix.
    a_values: 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`.
      1-D.  The `values` of the first `SparseTensor`, size `[nnz]` Vector.
    a_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the first `SparseTensor`, size `[ndims]` Vector.
    b_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the second `SparseTensor`, size `[nnz, ndims]` Matrix.
    b_values: A `Tensor`. Must have the same type as `a_values`.
      1-D.  The `values` of the second `SparseTensor`, size `[nnz]` Vector.
    b_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the second `SparseTensor`, size `[ndims]` Vector.
    thresh: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      0-D.  The magnitude threshold that determines if an output value/index
      pair takes space.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (sum_indices, sum_values, sum_shape).

    sum_indices: A `Tensor` of type `int64`.
    sum_values: A `Tensor`. Has the same type as `a_values`.
    sum_shape: A `Tensor` of type `int64`.
  r   Nr<   r=   )r   r   r   r   r   r   r   r<   r@   Treal)rA   r   rB   rC   r   rD   _SparseAddOutputr|   rE   rF   rG   rH   rI   sparse_add_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r   r   r   r   r   r   r   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                    r_   
sparse_addr     s   T 
			0h..0$#\\	11k4Hgy'6#g !&&w/gn (88y8W(8W"/!QX QK'""$3%%c*G  )+F::L\674""7+'	./ && -
##At,,## 
&
Xw	8Wf  ## 
s0    4D E#D>>EEE/ /FFzraw_ops.SparseAddc	                    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                  |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*                  g      \  }\  }t-        j.                  | t        j                        } t-        j.                  |t        j                        }t-        j.                  |t        j                        }t-        j.                  |t        j                        }| ||||||g}d|	d|f}t        j0                  dd||||      }t        j2                         rt        j4                  d|||       t6        j9                  |      }|S )Nr@   r   s	   SparseAddr   rd   r   )rL   rg   ri   float32float64int32uint8int16int8	complex64rj   qint8quint8qint32bfloat16qint16quint16uint16
complex128halfuint32uint64rG   rh   r   rP   rT   r   r|   )r   r   r   r   r   r   r   r<   r=   rl   	_inputs_T_attr_Trealr^   r]   rX   s                  r_   r   r     sn   66(7KSSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  qB  qB  DK  DQ  DQ  SZ  S`  S`  bi  bp  bp  ry  r@  r@  BI  BR  BR  T[  Tb  Tb  dk  ds  ds  u|  uC  uC  EL  EW  EW  Y`  Ye  Ye  gn  gu  gu  w~  wE  wE  SH  I'9"8X#::F8S7??\c\k\kmtmzmz  }D  }J  }J  LS  LY  LY  [b  [g  [g  ip  iv  iv  x  xH  xH  JQ  JX  JX  Za  Zf  Zf  ho  hv  hv  x  xF  xF  KI  J+y$$Y>)""7GMM:'$$Y>)""7GMM:'Xw	8WfU,';/&\1\#)s?'""$\674""7+'	.rm   SparseAddGrad
a_val_grad
b_val_gradTV_SparseAddGrad_Tbackprop_val_gradr   c           	         t         j                   xs t        j                         }|j                  }|j                  r3	 t	        j
                  |d|| |||      }t        j                  |      }|S t        j                   d| ||||      \  }	}	}
}|dd }t#        j$                         r7d|
j'                  d      f}|
j(                  }t#        j*                  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  The gradient operator for the SparseAdd op.

  The SparseAdd op calculates A + B, where A, B, and the sum are all represented
  as `SparseTensor` objects.  This op takes in the upstream gradient w.r.t.
  non-empty values of the sum, and outputs the gradients w.r.t. the non-empty
  values of A and B.

  Args:
    backprop_val_grad: 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`.
      1-D with shape `[nnz(sum)]`.  The gradient with respect to
      the non-empty values of the sum.
    a_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the `SparseTensor` A, size `[nnz(A), ndims]`.
    b_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the `SparseTensor` B, size `[nnz(B), ndims]`.
    sum_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the sum `SparseTensor`, size
      `[nnz(sum), ndims]`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (a_val_grad, b_val_grad).

    a_val_grad: A `Tensor`. Has the same type as `backprop_val_grad`.
    b_val_grad: A `Tensor`. Has the same type as `backprop_val_grad`.
  r   Nr   )r   r   r   r   r<   r@   )rA   r   rB   rC   r   rD   _SparseAddGradOutputr|   rE   rF   rG   rH   rI   sparse_add_grad_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r   r   r   r   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   sparse_add_gradr     sn   6 
			0h..0$#\\	11ot%6	9g %**73gn (88+<#,	%0t=!QX QK'""$3%%c*+F::Lvw8 &&w/'	.- && -
##At,,## 
+
Y	;T  ## 
0    1C9 9E D''E ?E E E+*E+zraw_ops.SparseAddGradc                    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                        }t-        j.                  |t        j                        }t-        j.                  |t        j                        }| |||g}d|f}t        j0                  dd||||      }	t        j2                         rt        j4                  d|||	       t6        j9                  |	      }	|	S )Nr@   s   SparseAddGrad   rd   r   )rL   rg   ri   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   rG   rh   r   rP   rT   r   r|   )
r   r   r   r   r<   r=   rl   r^   r]   rX   s
             r_   r   r   *  sR   "*"A"ACTBUWZ]d]l]lnun}n}  @G  @M  @M  OV  O\  O\  ^e  ^k  ^k  mt  my  my  {B  {L  {L  NU  N[  N[  ]d  ]j  ]j  ls  lz  lz  |C  |J  |J  LS  L\  L\  ^e  ^l  ^l  nu  n}  n}  F  M  M  OV  Oa  Oa  cj  co  co  qx  q  q  AH  AO  AO  ]R  #S'$$Y>)$$Y>)&&{GMMB+#Y	;G,>&-q#)s?'""$vw8 &&w/'	.rm   SparseConcat)output_indicesoutput_valuesoutput_shape) TV_SparseConcat_Tr   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/   r0   r1   r2   indicesvaluesshapes
concat_dimc           
         t         j                   xs t        j                         }|j                  }|j                  r4	 t	        j
                  |d|| ||d|      }t        j                  |      }|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+        j,                  |d      }t/        j0                  d| ||||
      \  }
}
}}|dd }t+        j2                         rYd|j5                  d      d|j5                  d      d|j7                  d      f}|j8                  }t+        j:                  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  Concatenates a list of `SparseTensor` along the specified dimension.

  Concatenation is with respect to the dense versions of these sparse tensors.
  It is assumed that each input is a `SparseTensor` whose elements are ordered
  along increasing dimension number.

  All inputs' shapes must match, except for the concat dimension.  The
  `indices`, `values`, and `shapes` lists must have the same length.

  The output shape is identical to the inputs', except along the concat
  dimension, where it is the sum of the inputs' sizes along that dimension.

  The output elements will be resorted to preserve the sort order along
  increasing dimension number.

  This op runs in `O(M log M)` time, where `M` is the total number of non-empty
  values across all inputs. This is due to the need for an internal sort in
  order to concatenate efficiently across an arbitrary dimension.

  For example, if `concat_dim = 1` and the inputs are

      sp_inputs[0]: shape = [2, 3]
      [0, 2]: "a"
      [1, 0]: "b"
      [1, 1]: "c"

      sp_inputs[1]: shape = [2, 4]
      [0, 1]: "d"
      [0, 2]: "e"

  then the output will be

      shape = [2, 7]
      [0, 2]: "a"
      [0, 4]: "d"
      [0, 5]: "e"
      [1, 0]: "b"
      [1, 1]: "c"

  Graphically this is equivalent to doing

      [    a] concat [  d e  ] = [    a   d e  ]
      [b c  ]        [       ]   [b c          ]

  Args:
    indices: A list of at least 2 `Tensor` objects with type `int64`.
      2-D.  Indices of each input `SparseTensor`.
    values: A list with the same length as `indices` of `Tensor` objects with the same type.
      1-D.  Non-empty values of each `SparseTensor`.
    shapes: A list with the same length as `indices` of `Tensor` objects with type `int64`.
      1-D.  Shapes of each `SparseTensor`.
    concat_dim: An `int`.
      Dimension to concatenate along. Must be in range [-rank, rank),
      where rank is the number of dimensions in each input `SparseTensor`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `values`.
    output_shape: A `Tensor` of type `int64`.
  r   r   N)r   r<   r=   CExpected list for 'indices' argument to 'sparse_concat' Op, not %r.BExpected list for 'values' argument to 'sparse_concat' Op, not %r.gList argument 'values' to 'sparse_concat' Op with length %d must match length %d of argument 'indices'.BExpected list for 'shapes' argument to 'sparse_concat' Op, not %r.gList argument 'shapes' to 'sparse_concat' Op with length %d must match length %d of argument 'indices'.)r   r   r   r   r<   Nr@   )rA   r   rB   rC   r   rD   _SparseConcatOutputr|   rE   rF   rG   rH   rI   sparse_concat_eager_fallbackrK   
isinstancelisttuple	TypeErrorlen
ValueErrorrL   make_intrN   rO   rP   _get_attr_intrQ   rS   rT   )r   r   r   r   r<   rV   rW   rX   rY   _attr_NrZ   r[   r\   r]   r^   s                  r_   sparse_concatr   @  s   @ 
			0h..0$#\\	11ndGVV\g $))'2gn 
GdE]	+
	&(/	01 1 L'	FT5M	*
	&(.	/0 0 	[G
	6	Vg	    
FT5M	*
	&(.	/0 0 	[G
	6	Vg	      \:*'88v#-D:!QX QK'""$C--l;S$c3+=+=c+BDF::Lfg7%%g.'	.[ && -
##At,,## 
)
66jtO O## 
s0    2G7 7H>
H%%H>=H>I I*)I*zraw_ops.SparseConcatc                    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        j                  |d      }t        j                  t        |      |g       \  }}t        j                  | t        j                        } t        j                  |t        j                        }t        |       t        |      z   t        |      z   }d|d|d|f}	t        j                  d	d
||	||      }
t        j                         rt        j                  d||	|
       t         j#                  |
      }
|
S )Nr   r   r   r   r   r   r   r@   s   SparseConcatr   rd   r   )r   r   r   r   r   r   rL   r   rg   rG   convert_n_to_tensorri   rj   r   rP   rT   r   r|   )r   r   r   r   r<   r=   r   rl   r^   r]   rX   s              r_   r   r     s   	GdE]	+
	&(/	01 1 L'	FT5M	*
	&(.	/0 0 	[G
	6	Vg	    
FT5M	*
	&(.	/0 0 	[G
	6	Vg	      \:*33DL#rJ/'6$$Wgmm<'##FGMM:&gf-V<,*c7CA&_a#)s?'""$fg7%%g.'	.rm   SparseCrossTV_SparseCross_out_typeTV_SparseCross_internal_typehashed_outputnum_bucketshash_keyinternal_typec
                    t         j                   xs t        j                         }
|
j                  }|j                  r=	 t	        j
                  |
d|	| |||d|d|d|d|d|      }t        j                  |      }|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+        j,                  |d      }t+        j.                  |d      }t+        j.                  |d      }t+        j0                  |d      }t+        j0                  |d      }t3        j4                  d| |||||||||	      \  }}}}|dd }t+        j6                         rd|j9                  d      d|j;                  d      d|j9                  d      d|j9                  d      d|j=                  d      d|j=                  d      d|j?                  d      d|j?                  d      f}|j@                  }t+        jB                  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 bw xY w)a	  Generates sparse cross from a list of sparse and dense tensors.

  The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each
  representing features of one feature column. It outputs a 2D `SparseTensor` with
  the batchwise crosses of these features.

  For example, if the inputs are

      inputs[0]: SparseTensor with shape = [2, 2]
      [0, 0]: "a"
      [1, 0]: "b"
      [1, 1]: "c"

      inputs[1]: SparseTensor with shape = [2, 1]
      [0, 0]: "d"
      [1, 0]: "e"

      inputs[2]: Tensor [["f"], ["g"]]

  then the output will be

      shape = [2, 2]
      [0, 0]: "a_X_d_X_f"
      [1, 0]: "b_X_e_X_g"
      [1, 1]: "c_X_e_X_g"

  if hashed_output=true then the output will be

      shape = [2, 2]
      [0, 0]: FingerprintCat64(
                  Fingerprint64("f"), FingerprintCat64(
                      Fingerprint64("d"), Fingerprint64("a")))
      [1, 0]: FingerprintCat64(
                  Fingerprint64("g"), FingerprintCat64(
                      Fingerprint64("e"), Fingerprint64("b")))
      [1, 1]: FingerprintCat64(
                  Fingerprint64("g"), FingerprintCat64(
                      Fingerprint64("e"), Fingerprint64("c")))

  Args:
    indices: A list of `Tensor` objects with type `int64`.
      2-D.  Indices of each input `SparseTensor`.
    values: A list of `Tensor` objects with types from: `int64`, `string`.
      1-D.   values of each `SparseTensor`.
    shapes: A list with the same length as `indices` of `Tensor` objects with type `int64`.
      1-D.   Shapes of each `SparseTensor`.
    dense_inputs: A list of `Tensor` objects with types from: `int64`, `string`.
      2-D.    Columns represented by dense `Tensor`.
    hashed_output: A `bool`.
      If true, returns the hash of the cross instead of the string.
      This will allow us avoiding string manipulations.
    num_buckets: An `int` that is `>= 0`. It is used if hashed_output is true.
      output = hashed_value%num_buckets if num_buckets > 0 else hashed_value.
    hash_key: An `int`.
      Specify the hash_key that will be used by the `FingerprintCat64`
      function to combine the crosses fingerprints.
    out_type: A `tf.DType` from: `tf.int64, tf.string`.
    internal_type: A `tf.DType` from: `tf.int64, tf.string`.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor` of type `out_type`.
    output_shape: A `Tensor` of type `int64`.
  r   r   r   r   r   r   N)r   r   r   r   r   r<   r=   BExpected list for 'indices' argument to 'sparse_cross' Op, not %r.AExpected list for 'shapes' argument to 'sparse_cross' Op, not %r.fList argument 'shapes' to 'sparse_cross' Op with length %d must match length %d of argument 'indices'.)
r   r   r   dense_inputsr   r   r   r   r   r<   r   sparse_typesdense_types)"rA   r   rB   rC   r   rD   _SparseCrossOutputr|   rE   rF   rG   rH   rI   sparse_cross_eager_fallbackrK   r   r   r   r   r   r   rL   	make_boolr   r~   rN   rO   rP   r   _get_attr_boolrR   rQ   rS   rT   )r   r   r   r  r   r   r   r   r   r<   rV   rW   rX   rY   r   rZ   r[   r\   r]   r^   s                       r_   sparse_crossr    s   H 
			0h..0$#\\11mT7FFL{Hj(O	g
 #((1gn 
GdE]	+
	%'.	/0 0 L'	FT5M	*
	%'-	./ / 	[G
	6	Vg	    $$]OD-!!+}=+x4(*5($$]OD-'88wvf$0#. ( "!QX QK'""$3$$S)?  1=.

+^ll>*Mll=):  ,o  13F ::L|VW6$$W-'	.g && -
##At,,## 
(
66<}!Hx%Dd< < ## 
s0    ;I' 'J.:JJ.-J.2K KKzraw_ops.SparseCrossc                    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        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                  |d      }t        j                  ||
      \  }}t        j                  ||
      \  }}t        j                  | t        j                        } t        j                  |t        j                        }t        |       t        |      z   t        |      z   t        |      z   }d	|d|d|d|d
|d|d|d|f}t        j                  dd|||
|	      }t        j                          rt        j"                  d|||       t$        j'                  |      }|S )Nr   r   r   r   r   r   r   r   r   r  r  s   SparseCrossr   rd   r   )r   r   r   r   r   r   rL   r  r   r~   convert_to_mixed_eager_tensorsrG   r   ri   rj   r   rP   rT   r  r|   )r   r   r   r  r   r   r   r   r   r<   r=   r   _attr_sparse_types_attr_dense_typesr^   r]   rX   s                    r_   r  r  p  s   	GdE]	+
	%'.	/0 0 L'	FT5M	*
	%'-	./ / 	[G
	6	Vg	    $$]OD-!!+}=+x4(*5($$]OD-'FFvsSf$,$K$KLZ]$^!\$$Wgmm<'##FGMM:&gf-V<tL?QQ,/=-z8^5G"J/& ^Q|#)s?'""$|VW6$$W-'	.rm   SparseCrossHashedstrong_hashsaltc                 (   t         j                   xs t        j                         }|j                  }	|	j                  r6	 t	        j
                  |d|| ||||||
      }
t        j                  |
      }
|
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+        j,                  d| |||||||	      \  }}}}|dd }
t/        j0                         rYd|j3                  d      d	|j5                  d	      d
|j5                  d
      f}|j6                  }t/        j8                  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?	  Generates sparse cross from a list of sparse and dense tensors.

  The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each
  representing features of one feature column. It outputs a 2D `SparseTensor` with
  the batchwise crosses of these features.

  For example, if the inputs are

      inputs[0]: SparseTensor with shape = [2, 2]
      [0, 0]: "a"
      [1, 0]: "b"
      [1, 1]: "c"

      inputs[1]: SparseTensor with shape = [2, 1]
      [0, 0]: "d"
      [1, 0]: "e"

      inputs[2]: Tensor [["f"], ["g"]]

  then the output will be

      shape = [2, 2]
      [0, 0]: "a_X_d_X_f"
      [1, 0]: "b_X_e_X_g"
      [1, 1]: "c_X_e_X_g"

  if hashed_output=true then the output will be

      shape = [2, 2]
      [0, 0]: FingerprintCat64(
                  Fingerprint64("f"), FingerprintCat64(
                      Fingerprint64("d"), Fingerprint64("a")))
      [1, 0]: FingerprintCat64(
                  Fingerprint64("g"), FingerprintCat64(
                      Fingerprint64("e"), Fingerprint64("b")))
      [1, 1]: FingerprintCat64(
                  Fingerprint64("g"), FingerprintCat64(
                      Fingerprint64("e"), Fingerprint64("c")))

  Args:
    indices: A list of `Tensor` objects with type `int64`.
      2-D.  Indices of each input `SparseTensor`.
    values: A list of `Tensor` objects with types from: `int64`, `string`.
      1-D.   values of each `SparseTensor`.
    shapes: A list with the same length as `indices` of `Tensor` objects with type `int64`.
      1-D.   Shapes of each `SparseTensor`.
    dense_inputs: A list of `Tensor` objects with types from: `int64`, `string`.
      2-D.    Columns represented by dense `Tensor`.
    num_buckets: A `Tensor` of type `int64`.
      It is used if hashed_output is true.
      output = hashed_value%num_buckets if num_buckets > 0 else hashed_value.
    strong_hash: A `Tensor` of type `bool`.
      boolean, if true, siphash with salt will be used instead of farmhash.
    salt: A `Tensor` of type `int64`.
      Specify the salt that will be used by the siphash function.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor` of type `int64`.
    output_shape: A `Tensor` of type `int64`.
  r  Nr   IExpected list for 'indices' argument to 'sparse_cross_hashed' Op, not %r.HExpected list for 'shapes' argument to 'sparse_cross_hashed' Op, not %r.mList argument 'shapes' to 'sparse_cross_hashed' Op with length %d must match length %d of argument 'indices'.)r   r   r   r  r   r  r  r<   r   r  r  )rA   r   rB   rC   r   rD   _SparseCrossHashedOutputr|   rE   rF   rG   rH   rI   "sparse_cross_hashed_eager_fallbackrK   r   r   r   r   r   r   rN   rO   rL   rP   r   rR   rS   rT   )r   r   r   r  r   r  r  r<   rV   rW   rX   rY   r   rZ   r[   r\   r]   r^   s                     r_   sparse_cross_hashedr    s0   B 
			0h..0$#\\	11!4&&k;6g )..w7gn 
GdE]	+
	,.5	67 7 L'	FT5M	*
	,.4	56 6 	[G
	6	Vg	    (88WVF*6)4+"&T	3!QX
 QK'""$3$$S)>ll>*Mll=)+F ::L\67<$**73'	.O && -
##At,,## 
/
66<k
Tt% % ## 
s0    4F G".G		G"!G"&G: :HHzraw_ops.SparseCrossHashedc	                    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        j                  ||      \  }
}t        j                  ||      \  }}t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        j                  |t        j                        }t        |       t        |      z   t        |      z   t        |      z   |||gz   }d|	d|
d|f}t        j                  dd||||	      }t        j                         rt        j                   d
|||       t"        j%                  |      }|S )Nr  r  r  r   r  r  s   SparseCrossHashedr   rd   r  )r   r   r   r   r   r   rL   r
  rG   r   ri   rj   rh   boolr   rP   rT   r  r|   )r   r   r   r  r   r  r  r<   r=   r   r  r  r^   r]   rX   s                  r_   r  r    s   	GdE]	+
	,.5	67 7 L'	FT5M	*
	,.4	56 6 	[G
	6	Vg	     (FFvsSf$,$K$KLZ]$^!\$$Wgmm<'##FGMM:&&&{GMMB+&&{GLLA+			gmm	4$gf-V<tL?QQU`bmosTtt,.*<m&11\#)s?'""$\67<$**73'	.rm   SparseCrossV2sepc           
         t         j                   xs t        j                         }|j                  }|j                  r4	 t	        j
                  |d|| ||||      }t        j                  |      }|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+        j,                  d| |||||      \  }}}}|dd }t/        j0                         rYd|j3                  d      d	|j5                  d	      d
|j5                  d
      f}|j6                  }t/        j8                  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)a8  Generates sparse cross from a list of sparse and dense tensors.

  The op takes two lists, one of 2D `SparseTensor` and one of 2D `Tensor`, each
  representing features of one feature column. It outputs a 2D `SparseTensor` with
  the batchwise crosses of these features.

  For example, if the inputs are

      inputs[0]: SparseTensor with shape = [2, 2]
      [0, 0]: "a"
      [1, 0]: "b"
      [1, 1]: "c"

      inputs[1]: SparseTensor with shape = [2, 1]
      [0, 0]: "d"
      [1, 0]: "e"

      inputs[2]: Tensor [["f"], ["g"]]

  then the output will be

      shape = [2, 2]
      [0, 0]: "a_X_d_X_f"
      [1, 0]: "b_X_e_X_g"
      [1, 1]: "c_X_e_X_g"

  if hashed_output=true then the output will be

      shape = [2, 2]
      [0, 0]: FingerprintCat64(
                  Fingerprint64("f"), FingerprintCat64(
                      Fingerprint64("d"), Fingerprint64("a")))
      [1, 0]: FingerprintCat64(
                  Fingerprint64("g"), FingerprintCat64(
                      Fingerprint64("e"), Fingerprint64("b")))
      [1, 1]: FingerprintCat64(
                  Fingerprint64("g"), FingerprintCat64(
                      Fingerprint64("e"), Fingerprint64("c")))

  Args:
    indices: A list of `Tensor` objects with type `int64`.
      2-D.  Indices of each input `SparseTensor`.
    values: A list of `Tensor` objects with types from: `int64`, `string`.
      1-D.   values of each `SparseTensor`.
    shapes: A list with the same length as `indices` of `Tensor` objects with type `int64`.
      1-D.   Shapes of each `SparseTensor`.
    dense_inputs: A list of `Tensor` objects with types from: `int64`, `string`.
      2-D.    Columns represented by dense `Tensor`.
    sep: A `Tensor` of type `string`.
      string used when joining a list of string inputs, can be used as separator later.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor` of type `string`.
    output_shape: A `Tensor` of type `int64`.
  r  Nr   EExpected list for 'indices' argument to 'sparse_cross_v2' Op, not %r.DExpected list for 'shapes' argument to 'sparse_cross_v2' Op, not %r.iList argument 'shapes' to 'sparse_cross_v2' Op with length %d must match length %d of argument 'indices'.)r   r   r   r  r  r<   r   r  r  )rA   r   rB   rC   r   rD   _SparseCrossV2Outputr|   rE   rF   rG   rH   rI   sparse_cross_v2_eager_fallbackrK   r   r   r   r   r   r   rN   rO   rL   rP   r   rR   rS   rT   )r   r   r   r  r  r<   rV   rW   rX   rY   r   rZ   r[   r\   r]   r^   s                   r_   sparse_cross_v2r!  6  s!   x 
			0h..0$#\\	11otWfflg %**73gn 
GdE]	+
	(*1	23 3 L'	FT5M	*
	(*0	12 2 	[G
	6	Vg	    (88&2$H!QX QK'""$3$$S)>ll>*Mll=)+F ::Lvw8 &&w/'	.I && -
##At,,## 
+
66<4TK K## 
s0    2F G*GGG"G4 4H
Hzraw_ops.SparseCrossV2c                 d   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        j                  ||      \  }}t        j                  ||      \  }	}t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }t        |       t        |      z   t        |      z   t        |      z   |gz   }
d|d|d|	f}t        j                  dd|
|||	      }t        j                         rt        j                   d
|
||       t"        j%                  |      }|S )Nr  r  r  r   r  r  s   SparseCrossV2r   rd   r  )r   r   r   r   r   r   rL   r
  rG   r   ri   rj   rh   r   r   rP   rT   r  r|   )r   r   r   r  r  r<   r=   r   r  r  r^   r]   rX   s                r_   r   r     s   	GdE]	+
	(*1	23 3 L'	FT5M	*
	(*0	12 2 	[G
	6	Vg	     (FFvsSf$,$K$KLZ]$^!\$$Wgmm<'##FGMM:&sGNN3#gf-V<tL?QQUXTYY,.*<m&-q#)s?'""$vw8 &&w/'	.rm   TV_SparseDenseCwiseAdd_T
sp_indices	sp_valuessp_shapedensec           	         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  Adds up a SparseTensor and a dense Tensor, using these special rules:

  (1) Broadcasts the dense side to have the same shape as the sparse side, if
      eligible;
  (2) Then, only the dense values pointed to by the indices of the SparseTensor
      participate in the cwise addition.

  By these rules, the result is a logical SparseTensor with exactly the same
  indices and shape, but possibly with different non-zero values.  The output of
  this Op is the resultant non-zero values.

  Args:
    sp_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    sp_values: 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`.
      1-D.  `N` non-empty values corresponding to `sp_indices`.
    sp_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    dense: A `Tensor`. Must have the same type as `sp_values`.
      `R`-D.  The dense Tensor operand.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `sp_values`.
  SparseDenseCwiseAddNr   r$  r%  r&  r'  r<   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   %sparse_dense_cwise_add_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   r$  r%  r&  r'  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   sparse_dense_cwise_addr-    sS   6 
			0h..0$#\\11#T:y(g n (88*	(0DJ!QX QK'""$3%%c*+F::L|VW>('	.) && -
##At,,## 
2
i5tG G## 
0    C D&DDDD/ /EEzraw_ops.SparseDenseCwiseAddc                    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                        } t-        j.                  |t        j                        }| |||g}d|f}	t        j0                  dd||	||      }
t        j2                         rt        j4                  d||	|
       |
\  }
|
S )Nr@   s   SparseDenseCwiseAddrc   rd   r)  rL   rg   ri   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   rG   rh   r   rP   rT   r$  r%  r&  r'  r<   r=   rl   r   r^   r]   rX   s              r_   r+  r+    5   66	57I3QXQ`Q`bibqbqsz  tA  tA  CJ  CP  CP  RY  R_  R_  ah  am  am  ov  o@  o@  BI  BO  BO  QX  Q^  Q^  `g  `n  `n  pw  p~  p~  @G  @P  @P  RY  R`  R`  bi  bq  bq  sz  sA  sA  CJ  CU  CU  W^  Wc  Wc  el  es  es  u|  uC  uC  QF  G'9 9e%%j'--@*##Hgmm<(i59,>&3Q|#)s?'""$|VW>('	.rm   TV_SparseDenseCwiseDiv_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)a  Component-wise divides a SparseTensor by a dense Tensor.

  *Limitation*: this Op only broadcasts the dense side to the sparse side, but not
  the other direction.

  Args:
    sp_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    sp_values: 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`.
      1-D.  `N` non-empty values corresponding to `sp_indices`.
    sp_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    dense: A `Tensor`. Must have the same type as `sp_values`.
      `R`-D.  The dense Tensor operand.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `sp_values`.
  SparseDenseCwiseDivNr   r*  r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   %sparse_dense_cwise_div_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   r,  s                 r_   sparse_dense_cwise_divr7    sS   * 
			0h..0$#\\11#T:y(g n (88*	(0DJ!QX QK'""$3%%c*+F::L|VW>('	.) && -
##At,,## 
2
i5tG G## 
r.  zraw_ops.SparseDenseCwiseDivc                    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                        } t-        j.                  |t        j                        }| |||g}d|f}	t        j0                  dd||	||      }
t        j2                         rt        j4                  d||	|
       |
\  }
|
S )Nr@   s   SparseDenseCwiseDivrc   rd   r5  r0  r1  s              r_   r6  r6  J  r2  rm   TV_SparseDenseCwiseMul_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)a  Component-wise multiplies a SparseTensor by a dense Tensor.

  The output locations corresponding to the implicitly zero elements in the sparse
  tensor will be zero (i.e., will not take up storage space), regardless of the
  contents of the dense tensor (even if it's +/-INF and that INF*0 == NaN).

  *Limitation*: this Op only broadcasts the dense side to the sparse side, but not
  the other direction.

  Args:
    sp_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    sp_values: 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`.
      1-D.  `N` non-empty values corresponding to `sp_indices`.
    sp_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    dense: A `Tensor`. Must have the same type as `sp_values`.
      `R`-D.  The dense Tensor operand.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `sp_values`.
  SparseDenseCwiseMulNr   r*  r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   %sparse_dense_cwise_mul_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   r,  s                 r_   sparse_dense_cwise_mulr=  \  sS   2 
			0h..0$#\\11#T:y(g n (88*	(0DJ!QX QK'""$3%%c*+F::L|VW>('	.) && -
##At,,## 
2
i5tG G## 
r.  zraw_ops.SparseDenseCwiseMulc                    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                        } t-        j.                  |t        j                        }| |||g}d|f}	t        j0                  dd||	||      }
t        j2                         rt        j4                  d||	|
       |
\  }
|
S )Nr@   s   SparseDenseCwiseMulrc   rd   r;  r0  r1  s              r_   r<  r<    r2  rm   SparseFillEmptyRows)r   r   empty_row_indicatorreverse_index_map) TV_SparseFillEmptyRows_Tr   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/   r0   r1   r2   dense_shapedefault_valuec           	         t         j                   xs t        j                         }|j                  }|j                  r3	 t	        j
                  |d|| |||      }t        j                  |      }|S t        j                   d| ||||      \  }	}	}
}|dd }t#        j$                         r7d|
j'                  d      f}|
j(                  }t#        j*                  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)aJ  Fills empty rows in the input 2-D `SparseTensor` with a default value.

  The input `SparseTensor` is represented via the tuple of inputs
  (`indices`, `values`, `dense_shape`).  The output `SparseTensor` has the
  same `dense_shape` but with indices `output_indices` and values
  `output_values`.

  This op inserts a single entry for every row that doesn't have any values.
  The index is created as `[row, 0, ..., 0]` and the inserted value
  is `default_value`.

  For example, suppose `sp_input` has shape `[5, 6]` and non-empty values:

      [0, 1]: a
      [0, 3]: b
      [2, 0]: c
      [3, 1]: d

  Rows 1 and 4 are empty, so the output will be of shape `[5, 6]` with values:

      [0, 1]: a
      [0, 3]: b
      [1, 0]: default_value
      [2, 0]: c
      [3, 1]: d
      [4, 0]: default_value

  The output `SparseTensor` will be in row-major order and will have the
  same shape as the input.

  This op also returns an indicator vector shaped `[dense_shape[0]]` such that

      empty_row_indicator[i] = True iff row i was an empty row.

  And a reverse index map vector shaped `[indices.shape[0]]` that is used during
  backpropagation,

      reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]

  Args:
    indices: A `Tensor` of type `int64`.
      2-D. the indices of the sparse tensor.
    values: A `Tensor`. 1-D. the values of the sparse tensor.
    dense_shape: A `Tensor` of type `int64`.
      1-D. the shape of the sparse tensor.
    default_value: A `Tensor`. Must have the same type as `values`.
      0-D. default value to insert into location `[row, 0, ..., 0]`
        for rows missing from the input sparse tensor.
      output indices: 2-D. the indices of the filled sparse tensor.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, empty_row_indicator, reverse_index_map).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `values`.
    empty_row_indicator: A `Tensor` of type `bool`.
    reverse_index_map: A `Tensor` of type `int64`.
  r?  Nr   )r   r   rC  rD  r<   r@   )rA   r   rB   rC   r   rD   _SparseFillEmptyRowsOutputr|   rE   rF   rG   rH   rI   %sparse_fill_empty_rows_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r   r   rC  rD  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   sparse_fill_empty_rowsrH    sn   x 
			0h..0$#\\	11#T7FKg +009gn (88wv+6-:G!QX QK'""$3%%c*+F::L|VW>&,,W5'	.+ && -
##At,,## 
2
6;DdL L## 
r   zraw_ops.SparseFillEmptyRowsc                    t        j                  ||g|g       \  }}|\  }}t        j                  | t        j
                        } t        j                  |t        j
                        }| |||g}d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       t        j                  |
      }
|
S )Nr@   s   SparseFillEmptyRows   rd   r?  )rL   rg   rG   rh   ri   rj   r   rP   rT   rF  r|   )r   r   rC  rD  r<   r=   rl   r   r^   r]   rX   s              r_   rG  rG    s    667NPSUWX'9%6=""7GMM:'&&{GMMB+6;>,>&3Q|#)s?'""$|VW>&,,W5'	.rm   SparseFillEmptyRowsGradd_valuesd_default_value) TV_SparseFillEmptyRowsGrad_Tr   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/   r0   r1   r2   rA  grad_valuesc                    t         j                   xs t        j                         }|j                  }|j                  r1	 t	        j
                  |d|| |      }t        j                  |      }|S t        j                   d| ||      \  }}}}	|	dd }t#        j$                         r7d|j'                  d      f}
|j(                  }t#        j*                  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)aj  The gradient of SparseFillEmptyRows.

  Takes vectors reverse_index_map, shaped `[N]`, and grad_values,
  shaped `[N_full]`, where `N_full >= N` and copies data into either
  `d_values` or `d_default_value`.  Here `d_values` is shaped `[N]` and
  `d_default_value` is a scalar.

    d_values[j] = grad_values[reverse_index_map[j]]
    d_default_value = sum_{k : 0 .. N_full - 1} (
       grad_values[k] * 1{k not in reverse_index_map})

  Args:
    reverse_index_map: A `Tensor` of type `int64`.
      1-D.  The reverse index map from SparseFillEmptyRows.
    grad_values: A `Tensor`. 1-D.  The gradients from backprop.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (d_values, d_default_value).

    d_values: A `Tensor`. Has the same type as `grad_values`.
    d_default_value: A `Tensor`. Has the same type as `grad_values`.
  rK  Nr   )rA  rO  r<   r@   )rA   r   rB   rC   r   rD   _SparseFillEmptyRowsGradOutputr|   rE   rF   rG   rH   rI   *sparse_fill_empty_rows_grad_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )rA  rO  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s               r_   sparse_fill_empty_rows_gradrS  !  s_   0 
			0h..0$#\\11'/@+Og.44W=gn (88!5F/:G!QX QK'""$3%%c*+F::L!<B*009'	.) && -
##At,,## 
7
[t? ?## 
s0    /C5 5D<D##D<;D< E E%$E%zraw_ops.SparseFillEmptyRowsGradc                 P   t        j                  |g|g       \  }\  }t        j                  | t        j
                        } | |g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr@   s   SparseFillEmptyRowsGradr   rd   rK  )rL   rg   rG   rh   ri   rj   r   rP   rT   rQ  r|   )rA  rO  r<   r=   rl   r^   r]   rX   s           r_   rR  rR  Z  s    $;;[M3PRS'>K,,->N#[1,>&7$0C"&(' ""$!<B*009'	.rm   TV_SparseReduceMax_Tinput_indicesinput_valuesinput_shapereduction_axes	keep_dimsc                    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"                         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   Computes the max of elements across dimensions of a SparseTensor.

  This Op takes a SparseTensor and is the sparse counterpart to
  `tf.reduce_max()`.  In particular, this Op also returns a dense `Tensor`
  instead of a sparse one.

  Reduces `sp_input` along the dimensions given in `reduction_axes`.  Unless
  `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in
  `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained
  with length 1.

  If `reduction_axes` has no entries, all dimensions are reduced, and a tensor
  with a single element is returned.  Additionally, the axes can be negative,
  which are interpreted according to the indexing rules in Python.

  Args:
    input_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    input_values: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      1-D.  `N` non-empty values corresponding to `input_indices`.
    input_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    reduction_axes: A `Tensor` of type `int32`.
      1-D.  Length-`K` vector containing the reduction axes.
    keep_dims: An optional `bool`. Defaults to `False`.
      If true, retain reduced dimensions with length 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input_values`.
  SparseReduceMaxrZ  NrZ  r<   r=   FrV  rW  rX  rY  rZ  r<   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI    sparse_reduce_max_eager_fallbackrK   rL   r  rN   rO   rP   r  rQ   rS   rT   rV  rW  rX  rY  rZ  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                  r_   sparse_reduce_maxra  k     B 
			0h..0$#\\11}l^[)=g n I  K8)'88(4+*8I $	&!QX
 QK'""$3--k:C  %'F::L<:('	.7 && -
##At,,## 
-
{NDd4 4 ## 
0    D ED//EEE E54E5zraw_ops.SparseReduceMaxc                 b   |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                  g      \  }\  }t!        j"                  | t        j                        } t!        j"                  |t        j                        }t!        j"                  |t        j                        }| |||g}d|d|f}	t        j$                  dd||	||      }
t        j&                         rt        j(                  d||	|
       |
\  }
|
S )NFrZ  r@   s   SparseReduceMaxrc   rd   r\  )rL   r  rg   ri   r   r   r   r   r   r   rj   r   r   r   r   r   rG   rh   r   rP   rT   rV  rW  rX  rY  rZ  r<   r=   rl   r^   r]   rX   s              r_   r_  r_    s   I  K8)%<<l^SSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  q~  q~  @G  @P  @P  RY  R`  R`  bi  bn  bn  pw  p~  p~  @G  @N  @N  SQ  R'?L((F-&&{GMMB+)).'--H.{NK,C1&/<#)s?'""$<:('	.rm   SparseReduceMaxSparseTV_SparseReduceMaxSparse_Tc                 <   t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||d|	      }t        j                  |      }|S |d}t        j                   |d      }t#        j$                  d| |||||      \  }
}
}}|dd }t        j&                         rHd|j)                  d      d|j+                  d      f}|j,                  }t        j.                  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  Computes the max of elements across dimensions of a SparseTensor.

  This Op takes a SparseTensor and is the sparse counterpart to
  `tf.reduce_max()`.  In contrast to SparseReduceMax, this Op returns a
  SparseTensor.

  Reduces `sp_input` along the dimensions given in `reduction_axes`.  Unless
  `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in
  `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained
  with length 1.

  If `reduction_axes` has no entries, all dimensions are reduced, and a tensor
  with a single element is returned.  Additionally, the axes can be negative,
  which are interpreted according to the indexing rules in Python.

  Args:
    input_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    input_values: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      1-D.  `N` non-empty values corresponding to `input_indices`.
    input_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    reduction_axes: A `Tensor` of type `int32`.
      1-D.  Length-`K` vector containing the reduction axes.
    keep_dims: An optional `bool`. Defaults to `False`.
      If true, retain reduced dimensions with length 1.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `input_values`.
    output_shape: A `Tensor` of type `int64`.
  rf  rZ  Nr]  Fr^  r@   )rA   r   rB   rC   r   rD   _SparseReduceMaxSparseOutputr|   rE   rF   rG   rH   rI   'sparse_reduce_max_sparse_eager_fallbackrK   rL   r  rN   rO   rP   r  rQ   rS   rT   r`  s                  r_   sparse_reduce_max_sparserk       J 
			0h..0$#\\	11%t]L^[)=g -227;gn I  K8)'88}.:-80>+44A!QX QK'""$3--k:C  %'F::Lvw@(..w7'	.9 && -
##At,,## 
4
{NDd4 4 ## 
0    3D' 'E.:EE.-E.2F FFzraw_ops.SparseReduceMaxSparsec                    |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                  g      \  }\  }t!        j"                  | t        j                        } t!        j"                  |t        j                        }t!        j"                  |t        j                        }| |||g}d|d|f}	t        j$                  dd||	||      }
t        j&                         rt        j(                  d||	|
       t*        j-                  |
      }
|
S )NFrZ  r@   s   SparseReduceMaxSparser   rd   rf  )rL   r  rg   ri   r   r   r   r   r   r   rj   r   r   r   r   r   rG   rh   r   rP   rT   ri  r|   re  s              r_   rj  rj    s   I  K8)%<<l^SSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  q~  q~  @G  @P  @P  RY  R`  R`  bi  bn  bn  pw  p~  p~  @G  @N  @N  SQ  R'?L((F-&&{GMMB+)).'--H.{NK,C1&5q#)s?'""$vw@(..w7'	.rm   TV_SparseReduceSum_Tc                    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"                         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)am  Computes the sum of elements across dimensions of a SparseTensor.

  This Op takes a SparseTensor and is the sparse counterpart to
  `tf.reduce_sum()`.  In particular, this Op also returns a dense `Tensor`
  instead of a sparse one.

  Reduces `sp_input` along the dimensions given in `reduction_axes`.  Unless
  `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in
  `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained
  with length 1.

  If `reduction_axes` has no entries, all dimensions are reduced, and a tensor
  with a single element is returned.  Additionally, the axes can be negative,
  which are interpreted according to the indexing rules in Python.

  Args:
    input_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    input_values: 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`.
      1-D.  `N` non-empty values corresponding to `input_indices`.
    input_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    reduction_axes: A `Tensor` of type `int32`.
      1-D.  Length-`K` vector containing the reduction axes.
    keep_dims: An optional `bool`. Defaults to `False`.
      If true, retain reduced dimensions with length 1.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `input_values`.
  SparseReduceSumrZ  Nr]  Fr^  r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI    sparse_reduce_sum_eager_fallbackrK   rL   r  rN   rO   rP   r  rQ   rS   rT   r`  s                  r_   sparse_reduce_sumrs  1  rb  rc  zraw_ops.SparseReduceSumc                 4   |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,                  g      \  }\  }t/        j0                  | t        j                        } t/        j0                  |t        j                        }t/        j0                  |t        j                        }| |||g}d|d|f}	t        j2                  dd||	||      }
t        j4                         rt        j6                  d||	|
       |
\  }
|
S )NFrZ  r@   s   SparseReduceSumrc   rd   rq  )rL   r  rg   ri   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   rG   rh   r   rP   rT   re  s              r_   rr  rr  z  sb   I  K8)%<<l^SSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  qB  qB  DK  DQ  DQ  SZ  S`  S`  bi  bp  bp  ry  r@  r@  BI  BR  BR  T[  Tb  Tb  dk  ds  ds  u|  uC  uC  EL  EW  EW  Y`  Ye  Ye  gn  gu  gu  w~  wE  wE  SH  I'?L((F-&&{GMMB+)).'--H.{NK,C1&/<#)s?'""$<:('	.rm   SparseReduceSumSparseTV_SparseReduceSumSparse_Tc                 <   t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||d|	      }t        j                  |      }|S |d}t        j                   |d      }t#        j$                  d| |||||      \  }
}
}}|dd }t        j&                         rHd|j)                  d      d|j+                  d      f}|j,                  }t        j.                  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  Computes the sum of elements across dimensions of a SparseTensor.

  This Op takes a SparseTensor and is the sparse counterpart to
  `tf.reduce_sum()`.  In contrast to SparseReduceSum, this Op returns a
  SparseTensor.

  Reduces `sp_input` along the dimensions given in `reduction_axes`.  Unless
  `keep_dims` is true, the rank of the tensor is reduced by 1 for each entry in
  `reduction_axes`. If `keep_dims` is true, the reduced dimensions are retained
  with length 1.

  If `reduction_axes` has no entries, all dimensions are reduced, and a tensor
  with a single element is returned.  Additionally, the axes can be negative,
  which are interpreted according to the indexing rules in Python.

  Args:
    input_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    input_values: 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`.
      1-D.  `N` non-empty values corresponding to `input_indices`.
    input_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    reduction_axes: A `Tensor` of type `int32`.
      1-D.  Length-`K` vector containing the reduction axes.
    keep_dims: An optional `bool`. Defaults to `False`.
      If true, retain reduced dimensions with length 1.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `input_values`.
    output_shape: A `Tensor` of type `int64`.
  ru  rZ  Nr]  Fr^  r@   )rA   r   rB   rC   r   rD   _SparseReduceSumSparseOutputr|   rE   rF   rG   rH   rI   'sparse_reduce_sum_sparse_eager_fallbackrK   rL   r  rN   rO   rP   r  rQ   rS   rT   r`  s                  r_   sparse_reduce_sum_sparserz    rl  rm  zraw_ops.SparseReduceSumSparsec                 V   |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,                  g      \  }\  }t/        j0                  | t        j                        } t/        j0                  |t        j                        }t/        j0                  |t        j                        }| |||g}d|d|f}	t        j2                  dd||	||      }
t        j4                         rt        j6                  d||	|
       t8        j;                  |
      }
|
S )NFrZ  r@   s   SparseReduceSumSparser   rd   ru  )rL   r  rg   ri   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   rG   rh   r   rP   rT   rx  r|   re  s              r_   ry  ry    sl   I  K8)%<<l^SSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  qB  qB  DK  DQ  DQ  SZ  S`  S`  bi  bp  bp  ry  r@  r@  BI  BR  BR  T[  Tb  Tb  dk  ds  ds  u|  uC  uC  EL  EW  EW  Y`  Ye  Ye  gn  gu  gu  w~  wE  wE  SH  I'?L((F-&&{GMMB+)).'--H.{NK,C1&5q#)s?'""$vw@(..w7'	.rm   SparseReorderr   r   ) TV_SparseReorder_Tr   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/   r0   r1   r2   c                    t         j                   xs t        j                         }|j                  }|j                  r2	 t	        j
                  |d|| ||      }t        j                  |      }|S t        j                   d| |||      \  }}}	}
|
dd }t#        j$                         r7d|	j'                  d      f}|	j(                  }t#        j*                  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)ad  Reorders a SparseTensor into the canonical, row-major ordering.

  Note that by convention, all sparse ops preserve the canonical ordering along
  increasing dimension number. The only time ordering can be violated is during
  manual manipulation of the indices and values vectors to add entries.

  Reordering does not affect the shape of the SparseTensor.

  If the tensor has rank `R` and `N` non-empty values, `input_indices` has
  shape `[N, R]`, input_values has length `N`, and input_shape has length `R`.

  Args:
    input_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, possibly not in canonical ordering.
    input_values: A `Tensor`.
      1-D.  `N` non-empty values corresponding to `input_indices`.
    input_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `input_values`.
  r|  Nr   )rV  rW  rX  r<   r@   )rA   r   rB   rC   r   rD   _SparseReorderOutputr|   rE   rF   rG   rH   rI   sparse_reorder_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )rV  rW  rX  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                r_   sparse_reorderr    sc   8 
			0h..0$#\\11ot]L+Og$**73gn (88}&2"$!QX QK'""$3%%c*+F::Lvw8 &&w/'	.+ && -
##At,,## 
*
{4I I## 
s0    0C7 7D>
D%%D>=D>E E('E(zraw_ops.SparseReorderc                    t        j                  |g|g       \  }\  }t        j                  | t        j
                        } t        j                  |t        j
                        }| ||g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )Nr@   s   SparseReorderr   rd   r|  )rL   rg   rG   rh   ri   rj   r   rP   rT   r  r|   )	rV  rW  rX  r<   r=   rl   r^   r]   rX   s	            r_   r  r  9	  s    %<<l^SRTU'?L((F-&&{GMMB+{;,>&-q#)s?'""$vw8 &&w/'	.rm   SparseReshaper   	new_shapec                    t         j                   xs t        j                         }|j                  }|j                  r2	 t	        j
                  |d|| ||      }t        j                  |      }|S t        j                   d| |||      \  }}}	}
|
dd }t#        j$                         r&d}|	j&                  }t#        j(                  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  Reshapes a SparseTensor to represent values in a new dense shape.

  This operation has the same semantics as reshape on the represented dense
  tensor.  The `input_indices` are recomputed based on the requested `new_shape`.

  If one component of `new_shape` is the special value -1, the size of that
  dimension is computed so that the total dense size remains constant.  At
  most one component of `new_shape` can be -1.  The number of dense elements
  implied by `new_shape` must be the same as the number of dense elements
  originally implied by `input_shape`.

  Reshaping does not affect the order of values in the SparseTensor.

  If the input tensor has rank `R_in` and `N` non-empty values, and `new_shape`
  has length `R_out`, then `input_indices` has shape `[N, R_in]`,
  `input_shape` has length `R_in`, `output_indices` has shape `[N, R_out]`, and
  `output_shape` has length `R_out`.

  Args:
    input_indices: A `Tensor` of type `int64`.
      2-D.  `N x R_in` matrix with the indices of non-empty values in a
      SparseTensor.
    input_shape: A `Tensor` of type `int64`.
      1-D.  `R_in` vector with the input SparseTensor's dense shape.
    new_shape: A `Tensor` of type `int64`.
      1-D.  `R_out` vector with the requested new dense shape.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_shape: A `Tensor` of type `int64`.
  r  Nr   )rV  rX  r  r<    )rA   r   rB   rC   r   rD   _SparseReshapeOutputr|   rE   rF   rG   rH   rI   sparse_reshape_eager_fallbackrK   rN   rO   rL   rP   rS   rT   )rV  rX  r  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                r_   sparse_reshaper  L	  sS   F 
			0h..0$#\\11ot]KLg$**73gn (88}+#,49!QX QK'""$F::Lvw8 &&w/'	.) && -
##At,,## 
*
idF F## 
s0    0C& &D-9DD-,D-1E EEzraw_ops.SparseReshapec                    t        j                  | t        j                        } t        j                  |t        j                        }t        j                  |t        j                        }| ||g}d }t	        j
                  dd||||      }t	        j                         rt	        j                  d|||       t        j                  |      }|S )Ns   SparseReshaper   rd   r  )
rG   rh   ri   rj   rL   r   rP   rT   r  r|   )rV  rX  r  r<   r=   r^   r]   rX   s           r_   r  r  	  s    ((F-&&{GMMB+$$Y>)i8,&-q#)s?'""$vw8 &&w/'	.rm   SparseSlice) TV_SparseSlice_Tr   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/   r0   r1   r2   shapestartsizec           
         t         j                   xs t        j                         }|j                  }|j                  r4	 t	        j
                  |d|| ||||      }t        j                  |      }|S t        j                   d| |||||      \  }
}
}}|dd }t#        j$                         r7d|j'                  d      f}|j(                  }t#        j*                  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  Slice a `SparseTensor` based on the `start` and `size`.

  For example, if the input is

      input_tensor = shape = [2, 7]
      [    a   d e  ]
      [b c          ]

  Graphically the output tensors are:

      sparse_slice([0, 0], [2, 4]) = shape = [2, 4]
      [    a  ]
      [b c    ]

      sparse_slice([0, 4], [2, 3]) = shape = [2, 3]
      [ d e  ]
      [      ]

  Args:
    indices: A `Tensor` of type `int64`.
      2-D tensor represents the indices of the sparse tensor.
    values: A `Tensor`. 1-D tensor represents the values of the sparse tensor.
    shape: A `Tensor` of type `int64`.
      1-D. tensor represents the shape of the sparse tensor.
    start: A `Tensor` of type `int64`.
      1-D. tensor represents the start of the slice.
    size: A `Tensor` of type `int64`.
      1-D. tensor represents the size of the slice.
      output indices: A list of 1-D tensors represents the indices of the output
      sparse tensors.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `values`.
    output_shape: A `Tensor` of type `int64`.
  r  Nr   )r   r   r  r  r  r<   r@   )rA   r   rB   rC   r   rD   _SparseSliceOutputr|   rE   rF   rG   rH   rI   sparse_slice_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r   r   r  r  r  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                  r_   sparse_slicer  	  so   P 
			0h..0$#\\11mT7FE5$Hg"((1gn (88wvU"D:!QX QK'""$3%%c*+F::L|VW6$$W-'	.) && -
##At,,## 
(
65%DdD D## 
s0    2C; ;ED))EEE E.-E.zraw_ops.SparseSlicec                 .   t        j                  |g|g       \  }\  }t        j                  | t        j
                        } t        j                  |t        j
                        }t        j                  |t        j
                        }t        j                  |t        j
                        }| ||||g}d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d||	|
       t        j                  |
      }
|
S )Nr@   s   SparseSlicer   rd   r  )rL   rg   rG   rh   ri   rj   r   rP   rT   r  r|   )r   r   r  r  r  r<   r=   rl   r^   r]   rX   s              r_   r  r  	  s    66xbI'9F""7GMM:'

 
 
6%

 
 
6%			gmm	4$65%6,>&^Q|#)s?'""$|VW6$$W-'	.rm   TV_SparseSliceGrad_Tinput_startc           	         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  The gradient operator for the SparseSlice op.

  This op takes in the upstream gradient w.r.t. non-empty values of
  the sliced `SparseTensor`, and outputs the gradients w.r.t.
  the non-empty values of input `SparseTensor`.

  Args:
    backprop_val_grad: 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`.
      1-D. The gradient with respect to
      the non-empty values of the sliced `SparseTensor`.
    input_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the input `SparseTensor`.
    input_start: A `Tensor` of type `int64`.
      1-D. tensor represents the start of the slice.
    output_indices: A `Tensor` of type `int64`.
      2-D.  The `indices` of the sliced `SparseTensor`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `backprop_val_grad`.
  SparseSliceGradNr   )r   rV  r  r   r<   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI    sparse_slice_grad_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r   rV  r  r   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   sparse_slice_gradr  
  sX   , 
			0h..0$#\\11'8-^%g n (88->)6'2*8t	E!QX
 QK'""$3%%c*+F::L<:('	./ && -
##At,,## 
-
]K  ## 
r.  zraw_ops.SparseSliceGradc                    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                        }t-        j.                  |t        j                        }t-        j.                  |t        j                        }| |||g}d|f}t        j0                  dd||||      }	t        j2                         rt        j4                  d|||	       |	\  }	|	S )Nr@   s   SparseSliceGradrc   rd   r  r0  )
r   rV  r  r   r<   r=   rl   r^   r]   rX   s
             r_   r  r  ;
  sI   "*"A"ACTBUWZ]d]l]lnun}n}  @G  @M  @M  OV  O\  O\  ^e  ^k  ^k  mt  my  my  {B  {L  {L  NU  N[  N[  ]d  ]j  ]j  ls  lz  lz  |C  |J  |J  LS  L\  L\  ^e  ^l  ^l  nu  n}  n}  F  M  M  OV  Oa  Oa  cj  co  co  qx  q  q  AH  AO  AO  ]R  #S'((F-&&{GMMB+)).'--H.#]KP,>&/<#)s?'""$<:('	.rm   TV_SparseSoftmax_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)a0  Applies softmax to a batched N-D `SparseTensor`.

  The inputs represent an N-D SparseTensor  with logical shape `[..., B, C]`
  (where `N >= 2`), and with indices sorted in the canonical lexicographic order.

  This op is equivalent to applying the normal `tf.nn.softmax()` to each innermost
  logical submatrix with shape `[B, C]`, but with the catch that *the implicitly
  zero elements do not participate*.  Specifically, the algorithm is equivalent
  to the following:

    (1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix
        with shape `[B, C]`, along the size-C dimension;
    (2) Masks out the original implicitly-zero locations;
    (3) Renormalizes the remaining elements.

  Hence, the `SparseTensor` result has exactly the same non-zero indices and
  shape.

  Args:
    sp_indices: A `Tensor` of type `int64`.
      2-D.  `NNZ x R` matrix with the indices of non-empty values in a
      SparseTensor, in canonical ordering.
    sp_values: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`.
      1-D.  `NNZ` non-empty values corresponding to `sp_indices`.
    sp_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `sp_values`.
  SparseSoftmaxNr   )r$  r%  r&  r<   r@   )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   sparse_softmax_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r$  r%  r&  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                r_   sparse_softmaxr  M
  sJ   @ 
			0h..0$#\\11otZHFgn (88J)"*7!QX QK'""$3%%c*+F::Lvw8('	.) && -
##At,,## 
*
i$@ @## 
s0    C D$C??DDD, ,EEzraw_ops.SparseSoftmaxc                    t        j                  |g|t        j                  t        j                  t        j
                  g      \  }\  }t        j                  | t        j                        } t        j                  |t        j                        }| ||g}d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr@   s   SparseSoftmaxrc   rd   r  )rL   rg   ri   r   r   r   rG   rh   rj   r   rP   rT   )	r$  r%  r&  r<   r=   rl   r^   r]   rX   s	            r_   r  r  
  s    "999+sW\\[b[j[jlsl{l{L~'<I%%j'--@*##Hgmm<(i2,>&-q#)s?'""$vw8('	.rm   SparseSparseMaximumTV_SparseSparseMaximum_Tc                    t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||||	      }	t        j                  |	      }	|	S t        j                   d| ||||||      \  }}}}|dd }	t#        j$                         r7d|j'                  d      f}|j(                  }t#        j*                  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  Returns the element-wise max of two SparseTensors.

  Assumes the two SparseTensors have the same shape, i.e., no broadcasting.

  Args:
    a_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, in the canonical lexicographic ordering.
    a_values: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      1-D.  `N` non-empty values corresponding to `a_indices`.
    a_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    b_indices: A `Tensor` of type `int64`.
      counterpart to `a_indices` for the other operand.
    b_values: A `Tensor`. Must have the same type as `a_values`.
      counterpart to `a_values` for the other operand; must be of the same dtype.
    b_shape: A `Tensor` of type `int64`.
      counterpart to `a_shape` for the other operand; the two shapes must be equal.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `a_values`.
  r  Nr   r   r   r   r   r   r   r<   r@   )rA   r   rB   rC   r   rD   _SparseSparseMaximumOutputr|   rE   rF   rG   rH   rI   $sparse_sparse_maximum_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   r   r   r   r   r   r   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                   r_   sparse_sparse_maximumr  
  z   6 
			0h..0$#\\	11#T9h8W&g +009gn (88X'.)(0'N!QX QK'""$3%%c*+F::L|VW>&,,W5'	.- && -
##At,,## 
1
Xw	8W  ## 
0    3C= =ED++EEE E10E1zraw_ops.SparseSparseMaximumc                    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                  g      \  }}	|	\  }}t        j                   | t        j                        } t        j                   |t        j                        }t        j                   |t        j                        }t        j                   |t        j                        }| |||||g}
d|f}t        j"                  dd|
|||      }t        j$                         rt        j&                  d|
||       t(        j+                  |      }|S )Nr@   s   SparseSparseMaximumr   rd   r  )rL   rg   ri   r   r   r   r   r   r   rj   r   r   r   r   r   rG   rh   r   rP   rT   r  r|   r   r   r   r   r   r   r<   r=   rl   r   r^   r]   rX   s                r_   r  r  
  s   66(7KSSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  q~  q~  @G  @P  @P  RY  R`  R`  bi  bn  bn  pw  p~  p~  @G  @N  @N  SQ  R'9"8X$$Y>)""7GMM:'$$Y>)""7GMM:'Xw	8WM,>&3Q|#)s?'""$|VW>&,,W5'	.rm   SparseSparseMinimumTV_SparseSparseMinimum_Tc                    t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||||	      }	t        j                  |	      }	|	S t        j                   d| ||||||      \  }}}}|dd }	t#        j$                         r7d|j'                  d      f}|j(                  }t#        j*                  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,  Returns the element-wise min of two SparseTensors.

  Assumes the two SparseTensors have the same shape, i.e., no broadcasting.

  Args:
    a_indices: A `Tensor` of type `int64`.
      2-D.  `N x R` matrix with the indices of non-empty values in a
      SparseTensor, in the canonical lexicographic ordering.
    a_values: 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`.
      1-D.  `N` non-empty values corresponding to `a_indices`.
    a_shape: A `Tensor` of type `int64`.
      1-D.  Shape of the input SparseTensor.
    b_indices: A `Tensor` of type `int64`.
      counterpart to `a_indices` for the other operand.
    b_values: A `Tensor`. Must have the same type as `a_values`.
      counterpart to `a_values` for the other operand; must be of the same dtype.
    b_shape: A `Tensor` of type `int64`.
      counterpart to `a_shape` for the other operand; the two shapes must be equal.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values).

    output_indices: A `Tensor` of type `int64`.
    output_values: A `Tensor`. Has the same type as `a_values`.
  r  Nr   r  r@   )rA   r   rB   rC   r   rD   _SparseSparseMinimumOutputr|   rE   rF   rG   rH   rI   $sparse_sparse_minimum_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   r  s                   r_   sparse_sparse_minimumr  
  r  r  zraw_ops.SparseSparseMinimumc                 r   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                        } t-        j.                  |t        j                        }t-        j.                  |t        j                        }t-        j.                  |t        j                        }| |||||g}
d|f}t        j0                  dd|
|||      }t        j2                         rt        j4                  d|
||       t6        j9                  |      }|S )Nr@   s   SparseSparseMinimumr   rd   r  )rL   rg   ri   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   rG   rh   r   rP   rT   r  r|   r  s                r_   r  r  8  sn   66(7KSSZSbSbdkdsdsu|  vC  vC  EL  ER  ER  T[  Ta  Ta  cj  co  co  qx  qB  qB  DK  DQ  DQ  SZ  S`  S`  bi  bp  bp  ry  r@  r@  BI  BR  BR  T[  Tb  Tb  dk  ds  ds  u|  uC  uC  EL  EW  EW  Y`  Ye  Ye  gn  gu  gu  w~  wE  wE  SH  I'9"8X$$Y>)""7GMM:'$$Y>)""7GMM:'Xw	8WM,>&3Q|#)s?'""$|VW>&,,W5'	.rm   SparseSplit) TV_SparseSplit_Tr   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/   r0   r1   r2   	split_dim	num_splitc                    t         j                   xs t        j                         }|j                  }|j                  r5	 t	        j
                  |d|| |||d|	      }t        j                  |      }|S t        j                   |d      }t#        j$                  d| |||||      \  }
}
}}|dd }t        j&                         rHd|j)                  d      d|j+                  d      f}|j,                  }t        j.                  d|||       |d| g||d z   }|dd |dd|z    gz   |d|z   d z   }|dd |dd gz   }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 Rw xY w)	a  Split a `SparseTensor` into `num_split` tensors along one dimension.

  If the `shape[split_dim]` is not an integer multiple of `num_split`. Slices
  `[0 : shape[split_dim] % num_split]` gets one extra dimension.
  For example, if `split_dim = 1` and `num_split = 2` and the input is

      input_tensor = shape = [2, 7]
      [    a   d e  ]
      [b c          ]

  Graphically the output tensors are:

      output_tensor[0] = shape = [2, 4]
      [    a  ]
      [b c    ]

      output_tensor[1] = shape = [2, 3]
      [ d e  ]
      [      ]

  Args:
    split_dim: A `Tensor` of type `int64`.
      0-D.  The dimension along which to split.  Must be in the range
      `[0, rank(shape))`.
    indices: A `Tensor` of type `int64`.
      2-D tensor represents the indices of the sparse tensor.
    values: A `Tensor`. 1-D tensor represents the values of the sparse tensor.
    shape: A `Tensor` of type `int64`.
      1-D. tensor represents the shape of the sparse tensor.
      output indices: A list of 1-D tensors represents the indices of the output
      sparse tensors.
    num_split: An `int` that is `>= 1`. The number of ways to split.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (output_indices, output_values, output_shape).

    output_indices: A list of `num_split` `Tensor` objects with type `int64`.
    output_values: A list of `num_split` `Tensor` objects with the same type as `values`.
    output_shape: A list of `num_split` `Tensor` objects with type `int64`.
  r  r  N)r  r<   r=   )r  r   r   r  r  r<   r@   rc   r   )rA   r   rB   rC   r   rD   _SparseSplitOutputr|   rE   rF   rG   rH   rI   sparse_split_eager_fallbackrK   rL   r   rN   rO   rP   r   rQ   rS   rT   )r  r   r   r  r  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                  r_   sparse_splitr  P  s   T 
			0h..0$#\\	11mT9gvuY g #((1gn 	;7)'88GF"idD!QX QK'""$3,,[93  %'F::L|VW6Zi !GIJ$77'BQK71Q]344wq9}~7NN'BQK712;-''$$W-'	.5 && -
##At,,## 
(
Wfeyt  ## 
s0    3E F&FFFF0 0GGzraw_ops.SparseSplitc                    t        j                  |d      }t        j                  |g|g       \  }\  }t        j                  | t
        j                        } t        j                  |t
        j                        }t        j                  |t
        j                        }| |||g}d|d|f}	t        j                  d||z   |z   ||	||      }
t        j                         rt        j                  d||	|
       |
d | g|
|d  z   }
|
d d |
dd|z    gz   |
d|z   d  z   }
|
d d |
dd  gz   }
t        j                  |
      }
|
S )Nr  r@   s   SparseSplitrd   r  rc   r   )rL   r   rg   rG   rh   ri   rj   r   rP   rT   r  r|   )r  r   r   r  r  r<   r=   rl   r^   r]   rX   s              r_   r  r    sU   	;7)66xbI'9F$$Y>)""7GMM:'

 
 
6%Wfe4,C1&^Y-B&.'/;6!$41' ""$|VW6Zi !GIJ$77'BQK71Q]344wq9}~7NN'BQK712;-''$$W-'	.rm   TV_SparseTensorDenseAdd_T TV_SparseTensorDenseAdd_Tindicesbc           	         t         j                   xs t        j                         }|j                  }|j                  r	 t	        j
                  |d|| |||      }|S 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  Adds up a `SparseTensor` and a dense `Tensor`, producing a dense `Tensor`.

  This Op does not require `a_indices` be sorted in standard lexicographic order.

  Args:
    a_indices: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      2-D.  The `indices` of the `SparseTensor`, with shape `[nnz, ndims]`.
    a_values: 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`.
      1-D.  The `values` of the `SparseTensor`, with shape `[nnz]`.
    a_shape: A `Tensor`. Must have the same type as `a_indices`.
      1-D.  The `shape` of the `SparseTensor`, with shape `[ndims]`.
    b: A `Tensor`. Must have the same type as `a_values`.
      `ndims`-D Tensor.  With shape `a_shape`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `a_values`.
  SparseTensorDenseAddNr   )r   r   r   r  r<   r@   Tindices)rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   &sparse_tensor_dense_add_eager_fallbackrK   rN   rO   rL   rP   rQ   rS   rT   )r   r   r   r  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   sparse_tensor_dense_addr    sc   & 
			0h..0$#\\11$dIx!Mgn (88)h(/14A!QX QK'""$3%%c*J  ,.F::Lfg?('	.+ && -
##At,,## 
3
Xw$@ @## 
s0    C$ $D+7DD+*D+/E   EEzraw_ops.SparseTensorDenseAddc                    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                  | |g|t        j
                  t        j                  g      \  }}	|	\  } }| |||g}
d|d|f}t        j,                  dd|
|||      }t        j.                         rt        j0                  d|
||       |\  }|S )Nr@   r  s   SparseTensorDenseAddrc   rd   r  )rL   rg   ri   r   r   r   r   r   r   r   rj   r   r   r   r   r   r   r   r   r   r   r   r   rP   rT   )r   r   r   r  r<   r=   rl   r   _attr_Tindices_inputs_Tindicesr^   r]   rX   s                r_   r  r    sF   66!}cGOO]d]l]lnun{n{  ~E  ~K  ~K  MT  MZ  MZ  \c  \h  \h  jq  j{  j{  }D  }J  }J  LS  LY  LY  [b  [i  [i  kr  ky  ky  {B  {K  {K  MT  M[  M[  ]d  ]l  ]l  nu  n|  n|  ~E  ~P  ~P  RY  R^  R^  `g  `n  `n  pw  p~  p~  LA  B'9-8Q%-%D%DiQXEY[^ahananpwp}p}  aA  &B".")9gXw2,*n5&4a#)s?'""$fg?('	.rm   ) TV_SparseTensorDenseMatMul_Tr   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/   r0   r1   r2   #TV_SparseTensorDenseMatMul_Tindices	adjoint_a	adjoint_bc                 p   t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |||d|d|      }	|	S |d}t        j                  |d      }|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 Sw xY w)
a  Multiply SparseTensor (of rank 2) "A" by dense matrix "B".

  No validity checking is performed on the indices of A.  However, the following
  input format is recommended for optimal behavior:

  if adjoint_a == false:
    A should be sorted in lexicographically increasing order.  Use SparseReorder
    if you're not sure.
  if adjoint_a == true:
    A should be sorted in order of increasing dimension 1 (i.e., "column major"
    order instead of "row major" order).

  Args:
    a_indices: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      2-D.  The `indices` of the `SparseTensor`, size `[nnz, 2]` Matrix.
    a_values: A `Tensor`.
      1-D.  The `values` of the `SparseTensor`, size `[nnz]` Vector.
    a_shape: A `Tensor` of type `int64`.
      1-D.  The `shape` of the `SparseTensor`, size `[2]` Vector.
    b: A `Tensor`. Must have the same type as `a_values`.
      2-D.  A dense Matrix.
    adjoint_a: An optional `bool`. Defaults to `False`.
      Use the adjoint of A in the matrix multiply.  If A is complex, this
      is transpose(conj(A)).  Otherwise it's transpose(A).
    adjoint_b: An optional `bool`. Defaults to `False`.
      Use the adjoint of B in the matrix multiply.  If B is complex, this
      is transpose(conj(B)).  Otherwise it's transpose(B).
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `a_values`.
  SparseTensorDenseMatMulr  r  N)r  r  r<   r=   F)r   r   r   r  r  r  r<   r@   r  )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   *sparse_tensor_dense_mat_mul_eager_fallbackrK   rL   r  rN   rO   rP   rQ   r  rS   rT   )r   r   r   r  r  r  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                   r_   sparse_tensor_dense_mat_mulr    s   B 
			0h..0$#\\11'y(G	;	;	;g n I  K8)I  K8)'88!Y+2a9-6TC!QX QK'""$3%%c*J  ,k  -{  -/F ::L!<B('	.? && -
##At,,## 
7
XwYDd4 4 ## 
s0     E   FE..FFF F54F5zraw_ops.SparseTensorDenseMatMulc                 B   |d}t        j                  |d      }|d}t        j                  |d      }t        j                  ||g|g       \  }}	|	\  }}t        j                  | g|t        j                  t        j
                  gt        j
                        \  }
\  } t        j                  |t        j
                        }| |||g}d|d|
d|d|f}t        j                  dd||||      }t        j                         rt        j                  d	|||       |\  }|S )
NFr  r  r@   r  s   SparseTensorDenseMatMulrc   rd   r  )rL   r  rg   ri   r   rj   rG   rh   r   rP   rT   )r   r   r   r  r  r  r<   r=   rl   r   r  r^   r]   rX   s                 r_   r  r  N  s4   I  K8)I  K8)66!}c2N'9-8Q!)!@!@)cT[TaTacjcpcpSsu|  vC  vC  "D.,9""7GMM:'Xw2,*nk9y&7$0C"&(' ""$!<B('	.rm   ) TV_SparseToDense_Tr   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/   r0   r1   r2   TV_SparseToDense_Tindicesvalidate_indicesc                    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"                         rYd|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  Converts a sparse representation into a dense tensor.

  Builds an array `dense` with shape `output_shape` such that

  ```
  # If sparse_indices is scalar
  dense[i] = (i == sparse_indices ? sparse_values : default_value)

  # If sparse_indices is a vector, then for each i
  dense[sparse_indices[i]] = sparse_values[i]

  # If sparse_indices is an n by d matrix, then for each i in [0, n)
  dense[sparse_indices[i][0], ..., sparse_indices[i][d-1]] = sparse_values[i]
  ```

  All other values in `dense` are set to `default_value`.  If `sparse_values` is a
  scalar, all sparse indices are set to this single value.

  Indices should be sorted in lexicographic order, and indices must not
  contain any repeats. If `validate_indices` is true, these properties
  are checked during execution.

  Args:
    sparse_indices: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      0-D, 1-D, or 2-D.  `sparse_indices[i]` contains the complete
      index where `sparse_values[i]` will be placed.
    output_shape: A `Tensor`. Must have the same type as `sparse_indices`.
      1-D.  Shape of the dense output tensor.
    sparse_values: A `Tensor`.
      1-D.  Values corresponding to each row of `sparse_indices`,
      or a scalar value to be used for all sparse indices.
    default_value: A `Tensor`. Must have the same type as `sparse_values`.
      Scalar value to set for indices not specified in
      `sparse_indices`.
    validate_indices: An optional `bool`. Defaults to `True`.
      If true, indices are checked to make sure they are sorted in
      lexicographic order and that there are no repeats.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `sparse_values`.
  SparseToDenser  N)r  r<   r=   T)r3   r   r4   rD  r  r<   r@   r  )rA   r   rB   rC   r   rD   rE   rF   rG   rH   rI   sparse_to_dense_eager_fallbackrK   rL   r  rN   rO   rP   r  rQ   rS   rT   )r3   r   r4   rD  r  r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                  r_   sparse_to_denser  i  s   V 
			0h..0$#\\11ot^\}&8:JLg n ''(8:LM'88&2'4'4*:G!QX QK'""$ #"4"45G"H#  %z  ,.F ::Lvw8('	.; && -
##At,,## 
+
,}+$DB B ## 
s0    D E%E  EEE/ /FFzraw_ops.SparseToDensec                    |d}t        j                  |d      }t        j                  ||g|g       \  }}|\  }}t        j                  | |g|t        j                  t        j
                  g      \  }	}
|
\  } }| |||g}d|d|d|	f}t        j                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )	NTr  r@   r  s   SparseToDenserc   rd   r  )	rL   r  rg   ri   r   rj   r   rP   rT   )r3   r   r4   rD  r  r<   r=   rl   r   r  r  r^   r]   rX   s                 r_   r  r    s   ''(8:LM66}7UWZ\^_'9#, =-%-%D%DnVbEcehkrkxkx  {B  {H  {H  kK  &L"."#3 >< ,}M, 0#w
&-q#)s?'""$vw8('	.rm   TakeManySparseFromTensorsMap) %TV_TakeManySparseFromTensorsMap_dtyper   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/   r0   r1   r2   sparse_handlesc                    t         j                   xs t        j                         }|j                  }|j                  r6	 t	        j
                  |d|| d|d|d|
      }t        j                  |      }|S t        j                   |d      }|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|||       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 ew xY w)	a	  Read `SparseTensors` from a `SparseTensorsMap` and concatenate them.

  The input `sparse_handles` must be an `int64` matrix of shape `[N, 1]` where
  `N` is the minibatch size and the rows correspond to the output handles of
  `AddSparseToTensorsMap` or `AddManySparseToTensorsMap`.  The ranks of the
  original `SparseTensor` objects that went into the given input ops must all
  match.  When the final `SparseTensor` is created, it has rank one
  higher than the ranks of the incoming `SparseTensor` objects
  (they have been concatenated along a new row dimension on the left).

  The output `SparseTensor` object's shape values for all dimensions but the
  first are the max across the input `SparseTensor` objects' shape values
  for the corresponding dimensions.  Its first shape value is `N`, the minibatch
  size.

  The input `SparseTensor` objects' indices are assumed ordered in
  standard lexicographic order.  If this is not the case, after this
  step run `SparseReorder` to restore index ordering.

  For example, if the handles represent an input, which is a `[2, 3]` matrix
  representing two original `SparseTensor` objects:

  ```
      index = [ 0]
              [10]
              [20]
      values = [1, 2, 3]
      shape = [50]
  ```

  and

  ```
      index = [ 2]
              [10]
      values = [4, 5]
      shape = [30]
  ```

  then the final `SparseTensor` will be:

  ```
      index = [0  0]
              [0 10]
              [0 20]
              [1  2]
              [1 10]
      values = [1, 2, 3, 4, 5]
      shape = [2 50]
  ```

  Args:
    sparse_handles: A `Tensor` of type `int64`.
      1-D, The `N` serialized `SparseTensor` objects.
      Shape: `[N]`.
    dtype: A `tf.DType`.
      The `dtype` of the `SparseTensor` objects stored in the
      `SparseTensorsMap`.
    container: An optional `string`. Defaults to `""`.
      The container name for the `SparseTensorsMap` read by this op.
    shared_name: An optional `string`. Defaults to `""`.
      The shared name for the `SparseTensorsMap` read by this op.
      It should not be blank; rather the `shared_name` or unique Operation name
      of the Op that created the original `SparseTensorsMap` should be used.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (sparse_indices, sparse_values, sparse_shape).

    sparse_indices: A `Tensor` of type `int64`.
    sparse_values: A `Tensor` of type `dtype`.
    sparse_shape: A `Tensor` of type `int64`.
  r  rw   r6   r7   N)rw   r6   r7   r<   r=   r>   )r  rw   r6   r7   r<   )rA   r   rB   rC   r   rD   #_TakeManySparseFromTensorsMapOutputr|   rE   rF   rG   rH   rI   0take_many_sparse_from_tensors_map_eager_fallbackrK   rL   r~   rM   rN   rO   rP   rQ   rR   rS   rT   )r  rw   r6   r7   r<   rV   rW   rX   rY   rZ   r[   r\   r]   r^   s                 r_   !take_many_sparse_from_tensors_mapr    s   T 
			0h..0$#\\	11,dNG{I}kCg 499'Bgn 

UG
,%I	;7)K!!+}=+'88&~.3y4?dL!QX QK'""$s))'2Kll;'ll=)+F ::L&fgG/55g>'	.? && -
##At,,## 
=
!$8 8 ## 
s0    4E( (F/;FF/.F/3G GGz$raw_ops.TakeManySparseFromTensorsMapc                    t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | t
        j                        } | g}d|d|d|f}t        j                  dd||||      }t        j                         rt        j                  d|||       t        j                  |      }|S )	Nrw   r>   r6   r7   s   TakeManySparseFromTensorsMapr   rd   r  )rL   r~   rM   rG   rh   ri   rj   r   rP   rT   r  r|   )	r  rw   r6   r7   r<   r=   r^   r]   rX   s	            r_   r  r  O  s    


UG
,%I	;7)K!!+}=+)).'--H. !,UKM&<a$0C"&(' ""$&fgG/55g>'	.rm   )r>   r>   N)N)FN)FFN)TN)__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   rA   r   rE   r   rL   tensorflow.python.frameworkr   ri   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   rG   r   rN   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   	_dispatch tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   r   Int64strr`   	to_raw_opr:   rJ   rn   rr   rp   rq   
namedtupler{   ru   Stringr   rt   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   intr   r   r   r  r   r   r  r  r   r  r  Boolr  r  r  r  r!  r  r   r#  r-  r)  r+  r3  r7  r5  r6  r9  r=  r;  r<  rF  rB  rH  r?  rG  rQ  rN  rS  rK  rR  rU  Int32ra  r\  r_  ri  rg  rk  rf  rj  ro  rs  rq  rr  rx  rv  rz  ru  ry  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  rm   r_   <module>r     s :  
  6 7 1 7 9 F K 3 I C 8 6 % % '!(  "`
 V9S'--=O3P Vajkn  qO  lO  bP V  `i  jm  ov  o|  o|  j|  `} V  IL V  ]` V  s|  }@  BI  BO  BO  }O  sP Vp KI&IJ>4>>ZxKyz )CQXQ^Q^L^B_ pyz}  @^  {^  q_   ox  y|  ~E  ~K  ~K  yK  oL   Y\   kn   ~G  HK  MT  MZ  MZ  HZ  ~[ , %  X
 JiW]]8J.K J\efi  lF  gF  ]G J  W`  ad  fm  fs  fs  as  Wt J  @C J  TW J  js  tw  y@  yF  yF  tF  jG JX C	"AB>4>>RkClm YsGMMGY=Z ktux  {U  vU  lV   fo  ps  u|  uB  uB  pB  fC   PS   be   u~  B  DK  DQ  DQ  Q  uR (  6{557 9 
 ")  "`
 Yygnn9L/M YVt Yv C	"AB>4>>RiCjk iW^^H[>\   fD  2;1179 
 %  X
 #*+MO_ar#s  Y)C9Y4Y*Z Yc} Yv ;I9:>4>>J\;]^ 3HhCh9i   sM  #  T
 ")*KM]_p"q  Y`  Yg  Yg  nr =)C4F*G =Xabegb  YA =  QZ  [^  `g  `m  `m  [m  Qn =  yX =  w@  AD  Fe  Ae  wf =~ ?i =>~t~~Nc?de 3CU9V gpqt  wO  rO  hP   `i  jm  ov  o|  o|  j|  `}   Ih   xA  BE  Gf  Bf  xg $   L
 %&CEUWhi  LS  LZ  LZ  ae 4YsGMM/A%B 4S\]`bv]vSw 4  HQ  RU  W^  Wd  Wd  Rd  He 4  pK 4  js  tw  yT  tT  jU 4l 7)56~t~~FV7WXIc7==>P4Q bklo  rF  mF  cG   W`  ad  fm  fs  fs  as  Wt   @[   kt  ux  zU  uU  kV " *;)).0 
 )+=?SUhj{  ~O  Q_  ap  rA  CR  Tb  dt  vF  HW  Yj  l|  ~N  P`  br  tC  D13EGXZkm{  ~M  O^  `o  q  AQ  Sc  eu  wF  G J)C$67 J9SR`M`Ca Jluvy  |C  |I  |I  wI  mJ J  W`  ad  fm  fs  fs  as  Wt J  @I  JM  O]  J]  @^ J  ir  sv  x  xE  xE  sE  iF J  PY  Z]  _q  Zq  Pr JX +I)*>4>>*+EF	33E)F R[\_ao\oRp   |E  FI  KR  KX  KX  FX  |Y   fo  ps  u|  uB  uB  pB  fC   OX  Y\  ^l  Yl  Om   xA  BE  GN  GT  GT  BT  xU   _h  il  n@  i@  _A $ .{--< " 
 13EG[]p  sD  FW  Yg  ix  zI  KZ  \j  l|  ~N  P_  ar  tD  FV  Xh  jz  |K  L :y6H1H'I :V_`celerer`rVs :  AJ  KN  PW  P]  P]  K]  A^ :  mv  wz  |C  |I  |I  wI  mJ :x 3	12>4>>/3RSiEW@W6X enort{  uB  uB  pB  fC   PY  Z]  _f  _l  _l  Zl  Pm   |E  FI  KR  KX  KX  FX  |Y  -k,,79 
   F
 v9T#Y%=> v	RVWZR[]nRnHo v  zC  DH  IL  DM  OV  O\  O\  D\  z] v  kn vp 1y/01NO$)DIw}}4L*M $W`aefiajl}a}W~ $  IR  SW  X[  S\  ^e  ^k  ^k  Sk  Il $  z} $L ,[++79 
 "";_N^_ &'EXhi B)DIw}}$<= ByY]^aYbdkdqdqYqOr B  RV B  eh B  tw B  CZ B  kG BH /i-.~t~~l/KL#49gmm3K)L #^ghlmphqsz  tA  tA  iA  _B #  ae #  tw #  CF #  Ri #  zV #J 2;1179 
q49gmm+C!D qV_`deh`ikrkxkx`xVy q  W`  ad  fm  fs  fs  as  Wt q  CL  MP  RY  R^  R^  M^  C_ q  gp  qt  v}  vC  vC  qC  gD qf ;I9:>4>>J];^_ 	$s)W]]:R0S enostwox  {B  {H  {H  pH  fI   fo  ps  u|  uB  uB  pB  fC   R[  \_  ah  am  am  \m  Rn   v  @C  EL  ER  ER  @R  vS B .{--79 
iYtCy'--'?@ iR[\`ad\egngtgt\tRu i  KT  UX  Za  Zh  Zh  Uh  Ki iV 3	12>4>>/3RSId3i6N,O ajkopsktv}  wD  wD  lD  bE   Zc  dg  ip  iw  iw  dw  Zx @ ##=?QSgi|  P  Rc  es  uD  FU  Wf  hv  xH  JZ  \k  m~  @P  Rb  dt  vF  HW  X 7ygmm1C'D 7QZ[^`x[xQy 7  FO  PS  U\  Ub  Ub  Pb  Fc 7  lu  vy  {S  vS  lT 7  dm  nq  sK  nK  dL 7r ?i =>~t~~Nd?ef iW]]@R6S `ijm  pH  kH  aI   U^  _b  dk  dq  dq  _q  Ur   {D  EH  Jb  Eb  {c   s|  }@  BZ  }Z  s[   ##=?QSgi|  P  Rc  es  uD  FU  Wf  hv  xH  JZ  \k  m~  @P  Rb  dt  vF  HW  X 1ygmm1C'D 1QZ[^`x[xQy 1  FO  PS  U\  Ub  Ub  Pb  Fc 1  lu  vy  {S  vS  lT 1  dm  nq  sK  nK  dL 1f ?i =>~t~~Nd?ef iW]]@R6S `ijm  pH  kH  aI   U^  _b  dk  dq  dq  _q  Ur   {D  EH  Jb  Eb  {c   s|  }@  BZ  }Z  s[   ##=?QSgi|  P  Rc  es  uD  FU  Wf  hv  xH  JZ  \k  m~  @P  Rb  dt  vF  HW  X 5ygmm1C'D 5QZ[^`x[xQy 5  FO  PS  U\  Ub  Ub  Pb  Fc 5  lu  vy  {S  vS  lT 5  dm  nq  sK  nK  dL 5n ?i =>~t~~Nd?ef iW]]@R6S `ijm  pH  kH  aI   U^  _b  dk  dq  dq  _q  Ur   {D  EH  Jb  Eb  {c   s|  }@  BZ  }Z  s[  4[33SU 
 #  T
 ZIc7==.@$A Z9UXZrUrKs Z  CL  MP  RY  R_  R_  M_  C` Z  qz  {~  @X  {X  qY Zx ?i =>~t~~Nd?ef 9S'--=O3P Zcdg  jB  eB  [C   R[  \_  ah  an  an  \n  Ro   @I  JM  Og  Jg  @h  "8!7!7"#"% 
  '   \
 49S'--=O3P 4_hil  oK  jK  `L 4l G)$EF~t~~VqGrs )CQXQ^Q^L^B_ nwx{  ~Z  yZ  o[  57IK\^oq  BQ  Sb  ds  uC  EU  Wg  iy  {J  K DYsGMM/A%B DR[\_au\uRv D  FO  PS  U\  Ub  Ub  Pb  Fc D  u~  B  DK  DQ  DQ  Q  uR D  ^b D  xA  BE  G[  B[  x\ DL 7)56~t~~FW7XYIc7==>P4Q ajkn  qE  lE  bF   U^  _b  dk  dq  dq  _q  Ur   DM  NQ  SZ  S`  S`  N`  Da   nr   BK  LO  Qe  Le  Bf $  6{557 9 
 %%ACUWhj{  ~L  N]  _n  p  AO  Qa  cs  uE  GV  W JIc7==6H,I JYbcf  iC  dC  ZD J  S\  ]`  bi  bo  bo  ]o  Sp J  BK  LO  QX  Q^  Q^  L^  B_ J  ko JX C	"AB>4>>RjCkl 9S'--EW;X hqru  xR  sR  iS   bk  lo  qx  q~  q~  l~  b   QZ  [^  `g  `m  `m  [m  Qn   { & 57IK_at  wH  J[  ]k  m|  ~M  O^  `n  p@  BR  Tc  ev  xH  JZ  \l  n~  @O  P DYsGMM/A%B DR[\_au\uRv D  FO  PS  U\  Ub  Ub  Pb  Fc D  u~  B  DK  DQ  DQ  Q  uR D  ^b D  xA  BE  G[  B[  x\ DL 7)56~t~~FW7XYIc7==>P4Q ajkn  qE  lE  bF   U^  _b  dk  dq  dq  _q  Ur   DM  NQ  SZ  S`  S`  N`  Da   nr   BK  LO  Qe  Le  Bf $  6{557 9 
 %%ACUWk  nA  CT  Vg  iw  yH  JY  [j  lz  |L  N^  `o  qB  DT  Vf  hx  zJ  L[  \ JIc7==6H,I JYbcf  iC  dC  ZD J  S\  ]`  bi  bo  bo  ]o  Sp J  BK  LO  QX  Q^  Q^  L^  B_ J  ko JX C	"AB>4>>RjCkl 9S'--EW;X hqru  xR  sR  iS   bk  lo  qx  q~  q~  l~  b   QZ  [^  `g  `m  `m  [m  Qn   { $ .{--') 
   H
 9)C,>"? 9yY\^pYpOq 9  AJ  KN  PW  P]  P]  K]  A^ 9v 3	12>4>>.3QR3;M1N ^ghkmh  _A   PY  Z]  _f  _l  _l  Zl  Pm  .{--~&( 
?)C,>"? ?iX[]d]j]jXjNk ?  yB  CF  HO  HU  HU  CU  yV ?B 3	12>4>>.3QR3;M1N ]fgjlslylygy]z   HQ  RU  W^  Wd  Wd  Rd  He  ,[++79 
   D
 D)C$67 D3P`K`Aa Djstw  zA  zG  zG  uG  kH D  QZ  [^  `g  `m  `m  [m  Qn D  v  @C  EL  ER  ER  @R  vS DL /i-.~t~~l/KL33E)F PYZ]_oZoPp   zC  DG  IP  IV  IV  DV  zW   `i  jm  ov  o|  o|  j|  `}   EN  OR  T[  Ta  Ta  Oa  Eb " 57IK_at  wH  J[  ]k  m|  ~M  O^  `n  p@  BR  Tc  ev  xH  JZ  \l  n~  @O  P 538L3L)M 5^ghkmtmzmzhz^{ 5  KT  UX  Za  Zg  Zg  Ug  Kh 5  zC  DG  IP  IV  IV  DV  zW 5  gp  qt  vJ  qJ  gK 5n 7)56~t~~FW7XY	#G[B[8\ mvwz  }D  }J  }J  xJ  nK   Zc  dg  ip  iv  iv  dv  Zw   IR  SV  X_  Xe  Xe  Se  If   v  @C  EY  @Y  vZ   13DFWYgh ;ygmm);< ;SVXjSjIk ;  xA  BE  GN  GT  GT  BT  xU ;  en  or  tF  oF  eG ;z 3	12>4>>.3QRiW]]8J.K XabegybyXz   GP  QT  V]  Vc  Vc  Qc  Gd   t}  ~A  CU  ~U  tV  4[33') 
 ##=?QSdfw  zH  JY  [j  l{  }K  M]  _o  qA  CR  S :YsGMM/A%B :iX[]uXuNv :  BK  LO  QX  Q^  Q^  L^  B_ :  lu  vy  {B  {H  {H  vH  lI :  U^  _b  d|  _|  U} :  HQ  RU  W^  Wd  Wd  Rd  He :x ?i =>~t~~Nc?de Ic7==>P4Q ]fgj  mE  hE  ^F   QZ  [^  `g  `m  `m  [m  Qn   {D  EH  JQ  JW  JW  EW  {X   dm  nq  sK  nK  dL   W`  ad  fm  fs  fs  as  Wt " 4[33') 
 ##=?QSgi|  P  Rc  es  uD  FU  Wf  hv  xH  JZ  \k  m~  @P  Rb  dt  vF  HW  X :YsGMM/A%B :iX[]uXuNv :  BK  LO  QX  Q^  Q^  L^  B_ :  lu  vy  {B  {H  {H  vH  lI :  U^  _b  d|  _|  U} :  HQ  RU  W^  Wd  Wd  Rd  He :x ?i =>~t~~Nc?de Ic7==>P4Q ]fgj  mE  hE  ^F   QZ  [^  `g  `m  `m  [m  Qn   {D  EH  JQ  JW  JW  EW  {X   dm  nq  sK  nK  dL   W`  ad  fm  fs  fs  as  Wt " ,[++79 
   D
 MIc7==&89 MIcSZS`S`N`Da Mktux  {K  vK  lL M  U^  _b  dk  dq  dq  _q  Ur M  B M^ /i-.~t~~l/KL9S'--5G+H S\]`bibobo]oSp   {D  EH  JZ  EZ  {[   dm  nq  sz  s@  s@  n@  dA   NQ * $$?ASUik~  AR  Te  gu  wF  HW  Yh  jx  zJ  L\  ^m  o@  BR  Td  fv  xH  JY  Z #*+M`o#p  /y6V1V'W /clmp  sL  nL  dM /  Xa  be  gG  bG  XH /  MV  WZ  \u  Wu  Mv /  FO  PS  Un  Pn  Fo /b Ay!?@PgAhi iEe@e6f r{|  B[  }[  s\   gp  qt  vV  qV  gW   \e  fi  kD  fD  \E   U^  _b  d}  _}  U~    '   \
 &-.SUdfu&v #H9S:]5]+^ Hjstw  zV  uV  kW H  bk  lo  qx  q~  q~  l~  b H  DM  NQ  So  No  Dp H  |@ H  RV H  lu  vy  {W  vW  lX HT G)$EF~t~~VqGrs )CIlDl:m   zC  DG  Ie  De  zf   qz  {~  @G  @M  @M  {M  qN   S\  ]`  b~  ]~  S   LP   ]a   qz  {~  @\  {\  q] 0   H
 #$?Rab PIc3L.L$M P]fgj  mF  hF  ^G P  Xa  be  gy  by  Xz P  KT  UX  Zl  Ul  Km P  @D P  Yb  cf  hz  cz  Y{ Pd 3	12>4>>/3RS9SB[=[3\ luvy  |U  wU  mV   gp  qt  vH  qH  gI   Zc  dg  i{  d{  Z|   PT   dm  nq  sE  nE  dF & '=k&<&<"7'9 #
 )0  )n
 %riW]]@R6S r  ]B r  NQ r  be rh  Qy)OPQ_QUQ_Q_  aB  RC   D YsT[TaTaOaEb   lQ   ^a   ps rm   