Ë
    AÆVh)  ã                   óÀ  — 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# d%de#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   fd„Z&  ed«       ejN                  e&«      «      Z(de#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   fd„Z)d%de#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejH                  f   f
d„Z*  ed«       ejN                  e*«      «      Z+de#e!ejH                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejJ                  f   de#e!ejH                  f   f
d„Z, ejZ                  dddg«      Z.d%de#e!ejH                  f   d e#e!ejH                  f   d!e#e!ejJ                  f   fd"„Z/  ed#«       ejN                  e/«      «      Z0de#e!ejH                  f   d e#e!ejH                  f   d!e#e!ejJ                  f   fd$„Z1y)&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Ú	distancesÚseedÚreturnc                 ób  — t         j                   xs t        j                  «       }|j                  }|j                  r	 t	        j
                  |d|| |«      }|S t        j                  d| ||¬«      \  }}}}	|	dd }t        j                   «       r&d}
|j"                  }t        j$                  d||
|«       |\  }|S # t        j                  $ r }t        j                  ||«       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||¬«      S # t        j                  $ r Y ŒÒw xY w)aÒ  Returns the index of a data point that should be added to the seed set.

  Entries in distances are assumed to be squared distances of candidate points to
  the already sampled centers in the seed set. The op constructs one Markov chain
  of the k-MC^2 algorithm and returns the index of one candidate point to be added
  as an additional cluster center.

  Args:
    distances: A `Tensor` of type `float32`.
      Vector with squared distances to the closest previously sampled cluster center
      for each candidate point.
    seed: A `Tensor` of type `int64`.
      Scalar. Seed for initializing the random number generator.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `int64`.
  ÚKMC2ChainInitializationN©ÚnameÚctx)r   r   r   © )Ú_contextr   Ú_thread_local_dataÚis_eagerr   ÚTFE_Py_FastPathExecuteÚ_coreÚ_NotOkStatusExceptionÚ_opsÚraise_from_not_ok_statusÚ_FallbackExceptionÚ(kmc2_chain_initialization_eager_fallbackÚ_SymbolicExceptionÚ_op_def_libraryÚ_apply_op_helperÚ_executeÚmust_record_gradientÚinputsÚrecord_gradient)r   r   r   Ú_ctxÚtldÚ_resultÚeÚ_Ú_opÚ_outputsÚ_attrsÚ_inputs_flats               úX/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_clustering_ops.pyÚkmc2_chain_initializationr7      s1  € ô& 
×	Ñ	Ò	0œh×.Ñ.Ó0€$Ø×Ñ€#Ø‡\‚\ðÜ×1Ñ1ØÐ'¨¨y¸$ó@€gà€nô (×8Ñ8Ø!¨Y¸TÈôNÑ€!€QˆˆXà‘QˆK€'Ü×"Ñ"Ô$Ø€FØ—:‘:€LÜ×ÑØ! <°¸ôBà(€'Ø	€.øô' ×&Ñ&ò -Ü
×#Ñ# A t×,Ñ,ûÜ×#Ñ#ò Ù
ðúðÜ5Ø
T ¨$ô0ð 0øä×#Ñ#ò Ù
ðús0   Á B> Â>DÃC,Ã,DÄDÄ	D ÄD.Ä-D.zraw_ops.KMC2ChainInitializationc                 ó8  — t        j                  | t        j                  «      } t        j                  |t        j                  «      }| |g}d }t        j                  dd||||¬«      }t        j                  «       rt        j                  d|||«       |\  }|S )Ns   KMC2ChainInitializationé   ©r+   Úattrsr   r   r   ©	r"   Úconvert_to_tensorÚ_dtypesÚfloat32Úint64r)   r   r*   r,   )r   r   r   r   r5   r4   r/   s          r6   r%   r%   K   sŽ   € Ü×$Ñ$ Y´·±Ó@€)Ü	×	Ñ	 ¤g§m¡mÓ	4€$Ø˜TÐ"€,Ø€&Ü×ÑÐ7¸Ø$0¸ÀCØ"&ô(€'ô ×"Ñ"Ô$Ü×ÑØ! <°¸ôBà(€'Ø	€.ó    ÚpointsÚnum_to_sampleÚnum_retries_per_samplec           	      ón  — t         j                   xs t        j                  «       }|j                  }|j                  r	 t	        j
                  |d|| |||«      }|S t        j                  d| ||||¬«      \  }	}	}
}|dd }t        j                   «       r&d}|
j"                  }t        j$                  d|||«       |\  }|S # t        j                  $ r }t        j                  ||«       Y d}~nd}~wt        j                  $ r Y nw xY w	 t        | |||||¬«      S # t        j                  $ r Y ŒÖw xY w)aV  Selects num_to_sample rows of input using the KMeans++ criterion.

  Rows of points are assumed to be input points. One row is selected at random.
  Subsequent rows are sampled with probability proportional to the squared L2
  distance from the nearest row selected thus far till num_to_sample rows have
  been sampled.

  Args:
    points: A `Tensor` of type `float32`.
      Matrix of shape (n, d). Rows are assumed to be input points.
    num_to_sample: A `Tensor` of type `int64`.
      Scalar. The number of rows to sample. This value must not be larger than n.
    seed: A `Tensor` of type `int64`.
      Scalar. Seed for initializing the random number generator.
    num_retries_per_sample: A `Tensor` of type `int64`.
      Scalar. For each row that is sampled, this parameter
      specifies the number of additional points to draw from the current
      distribution before selecting the best. If a negative value is specified, a
      heuristic is used to sample O(log(num_to_sample)) additional points.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `float32`.
  ÚKmeansPlusPlusInitializationNr   )rB   rC   r   rD   r   r   )r   r   r   r   r   r   r    r!   r"   r#   r$   Ú.kmeans_plus_plus_initialization_eager_fallbackr&   r'   r(   r)   r*   r+   r,   )rB   rC   r   rD   r   r-   r.   r/   r0   r1   r2   r3   r4   r5   s                 r6   Úkmeans_plus_plus_initializationrH   Z   sI  € ô2 
×	Ñ	Ò	0œh×.Ñ.Ó0€$Ø×Ñ€#Ø‡\‚\ðÜ×1Ñ1ØÐ,¨d°F¸MØÐ$ó&€gð €nô (×8Ñ8Ø&¨vØ6CØ-1Ø?UØ-1ô3Ñ€!€QˆˆXð ‘QˆK€'Ü×"Ñ"Ô$Ø€FØ—:‘:€LÜ×ÑØ&¨°f¸gôGà(€'Ø	€.øô1 ×&Ñ&ò -Ü
×#Ñ# A t×,Ñ,ûÜ×#Ñ#ò Ù
ðúðÜ;Ø
- Ð'=ÀDØôð øô ×#Ñ#ò Ù
ðús0   Á C ÃD	ÃC0Ã0D	ÄD	ÄD ÄD4Ä3D4z$raw_ops.KmeansPlusPlusInitializationc                 óÌ  — t        j                  | t        j                  «      } t        j                  |t        j                  «      }t        j                  |t        j                  «      }t        j                  |t        j                  «      }| |||g}d }t        j                  dd||||¬«      }t        j                  «       rt        j                  d|||«       |\  }|S )Ns   KmeansPlusPlusInitializationr9   r:   rF   r<   )	rB   rC   r   rD   r   r   r5   r4   r/   s	            r6   rG   rG   ˜   sÁ   € Ü×!Ñ! &¬'¯/©/Ó:€&Ü×(Ñ(¨¼¿¹ÓF€-Ü	×	Ñ	 ¤g§m¡mÓ	4€$Ü×1Ñ1Ð2HÌ'Ï-É-ÓXÐØ˜-¨Ð/EÐF€,Ø€&Ü×ÑÐ<¸aØ$0¸ÀCØ"&ô(€'ô ×"Ñ"Ô$Ü×ÑØ&¨°f¸gôGà(€'Ø	€.rA   ÚNearestNeighborsÚnearest_center_indicesÚnearest_center_distancesÚcentersÚkc                 ó´  — 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)at  Selects the k nearest centers for each point.

  Rows of points are assumed to be input points. Rows of centers are assumed to be
  the list of candidate centers. For each point, the k centers that have least L2
  distance to it are computed.

  Args:
    points: A `Tensor` of type `float32`.
      Matrix of shape (n, d). Rows are assumed to be input points.
    centers: A `Tensor` of type `float32`.
      Matrix of shape (m, d). Rows are assumed to be centers.
    k: A `Tensor` of type `int64`.
      Number of nearest centers to return for each point. If k is larger than m, then
      only m centers are returned.
    name: A name for the operation (optional).

  Returns:
    A tuple of `Tensor` objects (nearest_center_indices, nearest_center_distances).

    nearest_center_indices: A `Tensor` of type `int64`.
    nearest_center_distances: A `Tensor` of type `float32`.
  rJ   Nr   )rB   rM   rN   r   r   )r   r   r   r   r   r   Ú_NearestNeighborsOutputÚ_maker    r!   r"   r#   r$   Ú nearest_neighbors_eager_fallbackr&   r'   r(   r)   r*   r+   r,   )rB   rM   rN   r   r-   r.   r/   r0   r1   r2   r3   r4   r5   s                r6   Únearest_neighborsrS   ­   sN  € ô. 
×	Ñ	Ò	0œh×.Ñ.Ó0€$Ø×Ñ€#Ø‡\‚\ðÜ×1Ñ1ØÐ  $¨°¸ó<€gä'×-Ñ-¨gÓ6€gØ€nô (×8Ñ8Ø 6°7¸aÀdôLÑ€!€QˆˆXà‘QˆK€'Ü×"Ñ"Ô$Ø€FØ—:‘:€LÜ×ÑØ˜L¨&°'ô;ä#×)Ñ)¨'Ó2€'Ø	€.øô' ×&Ñ&ò -Ü
×#Ñ# A t×,Ñ,ûÜ×#Ñ#ò Ù
ðúðÜ-Ø
'˜1 4¨Tô3ð 3øä×#Ñ#ò Ù
ðús0   Á 0C& Ã&D-Ã9DÄD-Ä,D-Ä1E ÅEÅEzraw_ops.NearestNeighborsc                 ó¤  — 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   NearestNeighborsé   r:   rJ   )r"   r=   r>   r?   r@   r)   r   r*   r,   rP   rQ   )rB   rM   rN   r   r   r5   r4   r/   s           r6   rR   rR   ä   s«   € Ü×!Ñ! &¬'¯/©/Ó:€&Ü×"Ñ" 7¬G¯O©OÓ<€'Ü
×Ñ˜Q¤§¡Ó.€!Ø˜' 1Ð%€,Ø€&Ü×ÑÐ0°!¸LØ#)¨s¸ô?€'ä×"Ñ"Ô$Ü×ÑØ˜L¨&°'ô;ä#×)Ñ)¨'Ó2€'Ø	€.rA   )N)2Ú__doc__ÚcollectionsÚtensorflow.pythonr   Útensorflow.python.eagerr   r   r   r    r   r)   Útensorflow.python.frameworkr   r>   Útensorflow.security.fuzzing.pyr   Ú_atypesr	   Ú_op_def_registryr
   r"   r   r'   Ú"tensorflow.python.util.deprecationr   Útensorflow.python.utilr   Ú	_dispatchÚ tensorflow.python.util.tf_exportr   Útypingr   r   r   Útyping_extensionsr   ÚFloat32ÚInt64r7   Ú	to_raw_opr   r%   rH   rF   rG   Ú
namedtuplerP   rS   rJ   rR   r   rA   r6   ú<module>rh      s/  ðñó
 å 6Ý 7Ý 1Ý 7Ý 9Ý Få KÝ 3Ý IÝ CÝ 8Ý 6ç %Ñ %Ý 'ñ-¨°3¸¿¹Ð3GÑ)Hð -ÐPYÐZ]Ð_f×_lÑ_lÐZlÑPmð -ð  ~Gð  HKð  MT÷  MZñ  MZð  HZñ  ~[ó -ð^ G™)Ð$EÓFÀ~ÀtÇ~Á~ÐVoÓGpÓqÐ ð¸	À#ÀwÇÁÐBVÑ8Wð Ð_hÐilÐnu×n{Ñn{Ði{Ñ_|ð ð  MVð  WZð  \c÷  \iñ  \ið  Wiñ  Mjó ñ9¨I°c¸7¿?¹?Ð6JÑ,Kð 9Ð\eÐfiÐkr×kxÑkxÐfxÑ\yð 9ð  BKð  LOð  QX÷  Q^ñ  Q^ð  L^ñ  B_ð 9ð  yBð  CFð  HO÷  HUñ  HUð  CUñ  yVð 9ð  foð  psð  u|÷  uDñ  uDð  pDñ  fEó 9ðv  Q™yÐ)OÓPÐQ_ÐQU×Q_ÑQ_Ð`ó  RAó   BÐ ð¸9ÀSÈ'Ï/É/ÐEYÑ;Zð ÐktÐuxð  {B÷  {Hñ  {Hð  vHñ  lIð ð  QZð  [^ð  `g÷  `mñ  `mð  [mñ  Qnð ð  HQð  RUð  W^÷  Wdñ  Wdð  Rdñ  Heð ð  u~ð  Bð  DK÷  DSñ  DSð  Sñ  uTó ð  1˜+×0Ñ0ØØÐ9Ð:ó<Ð ñ
2˜i¨¨W¯_©_Ð(<Ñ=ð 2È	ÐRUÐW^×WfÑWfÐRfÑHgð 2ÐluÐvyð  |C÷  |Iñ  |Ið  wIñ  mJó 2ðh 9‘9Ð7Ó8¸¸¿¹ÐHYÓ9ZÓ[Ð ð¨Y°s¸G¿O¹OÐ7KÑ-Lð ÐW`ÐadÐfm×fuÑfuÐauÑWvð ð  |Eð  FIð  KR÷  KXñ  KXð  FXñ  |Yô rA   