
    AVhȬ                     
   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZm Z m!Z! ddl"m#Z#  eddddddddddddd      Z$ eddd      Z%ddejL                  dfde#e!e$f   d e#e!ejN                  f   d!e(d"e(d#e%d$e#e!e%f   fd%Z)  ed&       ejT                  e)            Z+de#e!e$f   d e#e!ejN                  f   d!e(d"e(d#e%d$e#e!e%f   fd'Z, ed(dddd      Z- ed)dd      Z.ded*e#e!e.f   d+e#e!e-f   d,e#e!e-f   d-e#e!e-f   d.e#e!e-f   d!e(d"e(d$e#e!e-f   fd/Z/  ed0       ejT                  e/            Z0d*e#e!e.f   d+e#e!e-f   d,e#e!e-f   d-e#e!e-f   d.e#e!e-f   d!e(d"e(d$e#e!e-f   fd1Z1 ed2dd      Z2 ed3ddd      Z3ded*e#e!e2f   d4e#e!e3f   d!e(d"e(d$e#e!e3f   f
d5Z4  ed6       ejT                  e4            Z5d*e#e!e2f   d4e#e!e3f   d!e(d"e(d$e#e!e3f   f
d7Z6 ed8dd      Z7dfd4e#e!e7f   d9e#e!e7f   d$e#e!e7f   fd:Z8  ed;       ejT                  e8            Z9d4e#e!e7f   d9e#e!e7f   d$e#e!e7f   fd<Z: ed=dd      Z; ed>ddd      Z<ded*e#e!e;f   d?e#e!e<f   d!e(d"e(d$e#e!e<f   f
d@Z=  edA       ejT                  e=            Z>d*e#e!e;f   d?e#e!e<f   d!e(d"e(d$e#e!e<f   f
dBZ? edCdd      Z@ edDddddd      ZA edEddddd      ZBddejL                  dfd*e#e!e@f   d?e#e!eAf   d!e(d"e(dFeBd$e#e!eBf   fdGZC  edH       ejT                  eC            ZDd*e#e!e@f   d?e#e!eAf   d!e(d"e(dFeBd$e#e!eBf   fdIZE edJ ZFdedKe#e!eFf   d!e(d"e(d$e#e!eFf   fdLZG  edM       ejT                  eG            ZHdKe#e!eFf   d!e(d"e(d$e#e!eFf   fdNZI edOdddd      ZJ edPdd      ZKded*e#e!eKf   dFeJd!e(d"e(d$e#e!eJf   f
dQZL  edR       ejT                  eL            ZMd*e#e!eKf   dFeJd!e(d"e(d$e#e!eJf   f
dSZN edTdddd      ZO edUdd      ZPded*e#e!ePf   dFeOd!e(d"e(d$e#e!eOf   f
dVZQ  edW       ejT                  eQ            ZRd*e#e!ePf   dFeOd!e(d"e(d$e#e!eOf   f
dXZS edYdd      ZT edZdd      ZUded*e#e!eUf   d[e#e!eTf   d\e#e!eTf   d!e(d"e(d$e#e!eTf   fd]ZV  ed^       ejT                  eV            ZWd*e#e!eUf   d[e#e!eTf   d\e#e!eTf   d!e(d"e(d$e#e!eTf   fd_ZX ed`dddd      ZY edadd      ZZded*e#e!eZf   dFeYd!e(d"e(d$e#e!eYf   f
dbZ[  edc       ejT                  e[            Z\d*e#e!eZf   dFeYd!e(d"e(d$e#e!eYf   f
ddZ]y)gzUPython 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_Multinomial_T_atypes.BFloat16_atypes.Float32_atypes.Float64_atypes.Half_atypes.Int16_atypes.Int32_atypes.Int64_atypes.Int8_atypes.UInt16_atypes.UInt32_atypes.UInt64_atypes.UInt8TV_Multinomial_output_dtypelogitsnum_samplesseedseed2output_dtypereturnc                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |d|d|d|      }|S |d}t        j                  |d      }|d}t        j                  |d      }|t        j                   }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        j0                  d|||       |\  }|S # t        j                  $ r }	t        j                  |	|       Y d}	~	nd}	~	wt        j                  $ r Y nw xY w	 t        | ||||||      S # t        j                  $ r Y yw xY w)
a  Draws samples from a multinomial distribution.

  Args:
    logits: A `Tensor`. Must be one of the following types: `float32`, `float64`, `int32`, `uint8`, `int16`, `int8`, `int64`, `bfloat16`, `uint16`, `half`, `uint32`, `uint64`.
      2-D Tensor with shape `[batch_size, num_classes]`.  Each slice `[i, :]`
      represents the unnormalized log probabilities for all classes.
    num_samples: A `Tensor` of type `int32`.
      0-D.  Number of independent samples to draw for each row slice.
    seed: An optional `int`. Defaults to `0`.
      If either seed or seed2 is set to be non-zero, the internal random number
      generator is seeded by the given seed.  Otherwise, a random seed is used.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    output_dtype: An optional `tf.DType` from: `tf.int32, tf.int64`. Defaults to `tf.int64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `output_dtype`.
  Multinomialr#   r$   r%   N)r#   r$   r%   namectxr   )r!   r"   r#   r$   r%   r)   T)_contextr   _thread_local_datais_eagerr   TFE_Py_FastPathExecute_core_NotOkStatusException_opsraise_from_not_ok_status_FallbackExceptionmultinomial_eager_fallback_SymbolicException_executemake_int_dtypesint64	make_type_op_def_library_apply_op_helpermust_record_gradient_get_attr_int_get_attr_typeinputsrecord_gradient)r!   r"   r#   r$   r%   r)   _ctxtld_resulte__op_outputs_attrs_inputs_flats                  T/home/dcms/DCMS/lib/python3.12/site-packages/tensorflow/python/ops/gen_random_ops.pymultinomialrM      s   ( 
			0h..0$#\\11mT6;g~|-g n 
\D			4	($
]E


E7
+%==L##L.A,'88f+D"DJ!QX QK'""$c''/(#s/A/A#/Fc00@BF ::L|VW6('	.A && -
##At,,## 
'
+D#$D: : ## 
s0     E' 'F.:FF.-F.2G GGzraw_ops.Multinomialc                 Z   |d}t        j                  |d      }|d}t        j                  |d      }|t        j                  }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                        }| |g}d|d|d|d|f}	t        j&                  dd||	||      }
t        j(                         rt        j*                  d	||	|
       |
\  }
|
S )
Nr   r#   r$   r%   r+   s   Multinomial   rA   attrsr*   r)   r(   )r7   r8   r9   r:   r;   args_to_matching_eagerfloat32float64int32uint8int16int8bfloat16uint16halfuint32uint64r2   convert_to_tensorr   r>   rB   )r!   r"   r#   r$   r%   r)   r*   _attr_TrK   rJ   rE   s              rL   r5   r5   ]   s   	\D			4	($
]E


E7
+%==L##L.A,66xwX_XgXgipivivx  yF  yF  HO  HU  HU  W^  Wc  Wc  el  er  er  t{  tD  tD  FM  FT  FT  V]  Vb  Vb  dk  dr  dr  t{  tB  tB  GE  F'9F&&{GMMB++&,D'5#w&^Q|#)s?'""$|VW6('	.    %TV_ParameterizedTruncatedNormal_dtype!TV_ParameterizedTruncatedNormal_Tshapemeansstdevsminvalsmaxvalsc                 v   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 Uw xY w)
a/  Outputs random values from a normal distribution. The parameters may each be a

  scalar which applies to the entire output, or a vector of length shape[0] which
  stores the parameters for each batch.

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The shape of the output tensor. Batches are indexed by the 0th dimension.
    means: A `Tensor`. Must be one of the following types: `half`, `bfloat16`, `float32`, `float64`.
      The mean parameter of each batch.
    stdevs: A `Tensor`. Must have the same type as `means`.
      The standard deviation parameter of each batch. Must be greater than 0.
    minvals: A `Tensor`. Must have the same type as `means`.
      The minimum cutoff. May be -infinity.
    maxvals: A `Tensor`. Must have the same type as `means`.
      The maximum cutoff. May be +infinity, and must be more than the minval
      for each batch.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `means`.
  ParameterizedTruncatedNormalr#   r$   Nr#   r$   r)   r*   r   )rc   rd   re   rf   rg   r#   r$   r)   dtyper+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   -parameterized_truncated_normal_eager_fallbackr6   r7   r8   r<   r=   r>   r?   r@   rA   rB   )rc   rd   re   rf   rg   r#   r$   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                    rL   parameterized_truncated_normalrm   x   s   : 
			0h..0$#\\11,dE5&&$8g n 
\D			4	($
]E


E7
+%'88&e5/5w07d.3$	@!QX
 QK'""$c''/('  )30B0B30GIF ::L&fgG('	.? && -
##At,,## 
:
t5  ## 
s0    !E F	E00F	F	F! !F87F8z$raw_ops.ParameterizedTruncatedNormalc	                 ^   |d}t        j                  |d      }|d}t        j                  |d      }t        j                  ||||g|t        j                  t        j
                  t        j                  t        j                  g      \  }	}
|
\  }}}}t        j                  | g|t        j                  t        j                  g      \  }\  } | ||||g}d|d|d|	d|f}t        j                  dd||||      }t        j                         rt        j                  d	|||       |\  }|S )
Nr   r#   r$   rk   r+   s   ParameterizedTruncatedNormalrO   rP   ri   )r7   r8   rR   r9   r[   rY   rS   rT   rU   r:   r   r>   rB   )rc   rd   re   rf   rg   r#   r$   r)   r*   _attr_dtype_inputs_dtyper_   rK   rJ   rE   s                  rL   rl   rl      s\   	\D			4	($
]E


E7
+%'>>vwX_?`behohthtv}  wG  wG  IP  IX  IX  Za  Zi  Zi  hl   m+}&3#5&'755ugsW]]T[TaTaDde'8E9,D'5';WM&<a$0C"&(' ""$&fgG('	.r`   TV_RandomGamma_STV_RandomGamma_Talphac                 d   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 Ow xY w)
aZ  Outputs random values from the Gamma distribution(s) described by alpha.

  This op uses the algorithm by Marsaglia et al. to acquire samples via
  transformation-rejection from pairs of uniform and normal random variables.
  See http://dl.acm.org/citation.cfm?id=358414

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      1-D integer tensor. Shape of independent samples to draw from each
      distribution described by the shape parameters given in alpha.
    alpha: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`.
      A tensor in which each scalar is a "shape" parameter describing the
      associated gamma distribution.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `alpha`.
  RandomGammar#   r$   Nrj   r   )rc   rs   r#   r$   r)   Sr+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   random_gamma_eager_fallbackr6   r7   r8   r<   r=   r>   r?   r@   rA   rB   )rc   rs   r#   r$   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                 rL   random_gammarx      s   2 
			0h..0$#\\11mT5%wOgn 
\D			4	($
]E


E7
+%'88U%d% "!QX QK'""$c''/(#s/A/A#/F  %'F ::L|VW6('	.9 && -
##At,,## 
(
TTtE E## 
0    D< <FE**FFF F/.F/zraw_ops.RandomGammac                 *   |d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  g      \  }\  } t        j                  |g|t        j                  t        j                  t        j                  g      \  }\  }| |g}d|d|d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d	||	|
       |
\  }
|
S )
Nr   r#   r$   rv   r+   s   RandomGammarO   rP   ru   r7   r8   rR   r9   rU   r:   r[   rS   rT   r   r>   rB   )rc   rs   r#   r$   r)   r*   _attr_Sr_   rK   rJ   rE   s              rL   rw   rw     s   	\D			4	($
]E


E7
+%55ugsW]]T[TaTaDde'8E55ugsW\\SZSbSbdkdsdsDvw'8E,D'5#wWE&^Q|#)s?'""$|VW6('	.r`   TV_RandomGammaGrad_Tsamplec                    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)aB  Computes the derivative of a Gamma random sample w.r.t. `alpha`.

  Args:
    alpha: A `Tensor`. Must be one of the following types: `float32`, `float64`.
    sample: A `Tensor`. Must have the same type as `alpha`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `alpha`.
  RandomGammaGradN)r)   r*   )rs   r~   r)   r+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4    random_gamma_grad_eager_fallbackr6   r<   r=   r7   r>   r@   rA   rB   )rs   r~   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s               rL   random_gamma_gradr   1  s?    
			0h..0$#\\11uf6gn (88vDB!QXQK'""$3%%c*+F::L<:('	.' && -
##At,,## 
-
d. .## 
s0    C D"C==DDD) )D?>D?zraw_ops.RandomGammaGradc                 *   t        j                  | |g|t        j                  t        j                  g      \  }}|\  } }| |g}d|f}t        j
                  dd||||      }t        j                         rt        j                  d|||       |\  }|S )Nr+   s   RandomGammaGradrO   rP   r   )r7   rR   r9   rS   rT   r   r>   rB   )	rs   r~   r)   r*   r_   	_inputs_TrK   rJ   rE   s	            rL   r   r   [  s    66vgoo_f_n_nMqr'9/5&,>&/<#)s?'""$<:('	.r`   TV_RandomPoisson_STV_RandomPoisson_dtyperatec                 d   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 Ow xY w)
a  Use RandomPoissonV2 instead.

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
    rate: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`.
    seed: An optional `int`. Defaults to `0`.
    seed2: An optional `int`. Defaults to `0`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `rate`.
  RandomPoissonr#   r$   Nrj   r   )rc   r   r#   r$   r)   rv   rk   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   random_poisson_eager_fallbackr6   r7   r8   r<   r=   r>   r?   r@   rA   rB   )rc   r   r#   r$   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                 rL   random_poissonr   l  s    
			0h..0$#\\11otUD&$g n 
\D			4	($
]E


E7
+%'88u4d%"$!QX QK'""$c''/(#s/A/A#/Fs))'24F ::Lvw8('	.9 && -
##At,,## 
*
DDdD D## 
ry   zraw_ops.RandomPoissonc                 *   |d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j                  t        j
                  g      \  }\  } t        j                  |g|t        j                  t        j                  t        j                  g      \  }\  }| |g}d|d|d|d|f}	t        j                  dd||	||      }
t        j                         rt        j                  d	||	|
       |
\  }
|
S )
Nr   r#   r$   rv   rk   s   RandomPoissonrO   rP   r   r{   )rc   r   r#   r$   r)   r*   r|   ro   rK   rJ   rE   s              rL   r   r     s	   	\D			4	($
]E


E7
+%55ugsW]]T[TaTaDde'8E!88$w||U\UdUdfmfufuFxy+w,D'5#wM&-q#)s?'""$vw8('	.r`   TV_RandomPoissonV2_STV_RandomPoissonV2_RTV_RandomPoissonV2_dtyperk   c                    t         j                   xs t        j                         }|j                  }|j                  r"	 t	        j
                  |d|| |d|d|d|      }|S |d}t        j                  |d      }|d}t        j                  |d      }|t        j                   }t        j"                  |d      }t%        j&                  d| |||||      \  }
}
}}|dd }t        j(                         r{d|j+                  d      d|j+                  d      d	|j-                  d	      d
|j-                  d
      d|j-                  d      f
}|j.                  }t        j0                  d|||       |\  }|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  Outputs random values from the Poisson distribution(s) described by rate.

  This op uses two algorithms, depending on rate. If rate >= 10, then
  the algorithm by Hormann is used to acquire samples via
  transformation-rejection.
  See http://www.sciencedirect.com/science/article/pii/0167668793909974.

  Otherwise, Knuth's algorithm is used to acquire samples via multiplying uniform
  random variables.
  See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer
  Programming, Volume 2. Addison Wesley

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      1-D integer tensor. Shape of independent samples to draw from each
      distribution described by the shape parameters given in rate.
    rate: A `Tensor`. Must be one of the following types: `half`, `float32`, `float64`, `int32`, `int64`.
      A tensor in which each scalar is a "rate" parameter describing the
      associated poisson distribution.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    dtype: An optional `tf.DType` from: `tf.half, tf.float32, tf.float64, tf.int32, tf.int64`. Defaults to `tf.int64`.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  RandomPoissonV2r#   r$   rk   Nr#   r$   rk   r)   r*   r   )rc   r   r#   r$   rk   r)   rv   R)r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4    random_poisson_v2_eager_fallbackr6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   )rc   r   r#   r$   rk   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                  rL   random_poisson_v2r     s   @ 
			0h..0$#\\11udFD'wg n 
\D			4	($
]E


E7
+%
]MME


UG
,%'88TE!&T3!QX QK'""$c''/(#s/A/A#/F  %w0B0B70KMF ::L<:('	.A && -
##At,,## 
-
DU  ## 
s0     E8 8F?F&&F?>F?G G,+G,zraw_ops.RandomPoissonV2c           
         |d}t        j                  |d      }|d}t        j                  |d      }|t        j                  }t        j                  |d      }t        j
                  | g|t        j                  t        j                  g      \  }\  } t        j
                  |g|t        j                  t        j                  t        j                  t        j                  t        j                  gt        j                        \  }\  }| |g}	d|d|d|d|d|f
}
t        j                  dd|	|
||	      }t        j                         rt        j                  d
|	|
|       |\  }|S )Nr   r#   r$   rk   rv   r   s   RandomPoissonV2rO   rP   r   )r7   r8   r9   r:   r;   rR   rU   r[   rS   rT   r   r>   rB   )rc   r   r#   r$   rk   r)   r*   r|   _attr_RrK   rJ   rE   s               rL   r   r     sr   	\D			4	($
]E


E7
+%
]MME


UG
,%55ugsW]]T[TaTaDde'8E44dVS7<<QXQ`Q`bibqbqsz  tA  tA  CJ  CP  CP  CS  U\  Ud  Ud  e'7D,D'5#wWg	&/<#)s?'""$<:('	.r`   ) TV_RandomShuffle_Tr   z_atypes.Boolz_atypes.Complex128z_atypes.Complex64z_atypes.Float16r   r   z_atypes.Float8e4m3b11fnuzz_atypes.Float8e4m3fnz_atypes.Float8e4m3fnuzz_atypes.Float8e5m2z_atypes.Float8e5m2fnuzr   r   r   z_atypes.Int4r   r   z_atypes.QInt16z_atypes.QInt32z_atypes.QInt8z_atypes.QUInt16z_atypes.QUInt8z_atypes.Resourcez_atypes.Stringr   r   z_atypes.UInt4r   r   z_atypes.Variantvaluec           
      <   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$  Randomly shuffles a tensor along its first dimension.

    The tensor is shuffled along dimension 0, such that each `value[j]` is mapped
    to one and only one `output[i]`. For example, a mapping that might occur for a
    3x2 tensor is:

  ```
  [[1, 2],       [[5, 6],
   [3, 4],  ==>   [1, 2],
   [5, 6]]        [3, 4]]
  ```

  Args:
    value: A `Tensor`. The tensor to be shuffled.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `value`.
  RandomShuffler#   r$   Nrj   r   )r   r#   r$   r)   r+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   random_shuffle_eager_fallbackr6   r7   r8   r<   r=   r>   r?   r@   rA   rB   )r   r#   r$   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                rL   random_shuffler   !  s   4 
			0h..0$#\\11otUFD'5Jgn 
\D			4	($
]E


E7
+%'88u4u4I!QXQK'""$c''/(#s/A/A#/FHF::Lvw8('	.5 && -
##At,,## 
*
d%d> >## 
s0    D) )E0<EE0/E04F FFzraw_ops.RandomShufflec                 T   |d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|g       \  }\  } | g}d|d|d|f}t        j                  dd||||      }t        j                         rt        j
                  d|||       |\  }|S )	Nr   r#   r$   r+   s   RandomShufflerO   rP   r   )r7   r8   rR   r   r>   rB   )	r   r#   r$   r)   r*   r_   rK   rJ   rE   s	            rL   r   r   a  s    	\D			4	($
]E


E7
+%55ugsBG'8E,D'5#w7&-q#)s?'""$vw8('	.r`   TV_RandomStandardNormal_dtypeTV_RandomStandardNormal_Tc                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S t        j                  |d      }|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 ew xY w)
a  Outputs random values from a normal distribution.

  The generated values will have mean 0 and standard deviation 1.

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The shape of the output tensor.
    dtype: A `tf.DType` from: `tf.half, tf.bfloat16, tf.float32, tf.float64`.
      The type of the output.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  RandomStandardNormalr#   r$   rk   Nr   r   rc   rk   r#   r$   r)   r+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   %random_standard_normal_eager_fallbackr6   r7   r;   r8   r<   r=   r>   r?   r@   rA   rB   rc   rk   r#   r$   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                 rL   random_standard_normalr   w  s   * 
			0h..0$#\\11$dE64wg n 

UG
,%	\D			4	($
]E


E7
+%'88e5t&+$8!QX QK'""$c''/('  )30B0B30GIF ::Lfg?('	.; && -
##At,,## 
2
d%u4TK K## 
0    E F&FFFF/ /GGzraw_ops.RandomStandardNormalc                    t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j
                  t        j                  g      \  }\  } | g}d|d|d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d	|||	       |	\  }	|	S )
Nrk   r   r#   r$   r+   s   RandomStandardNormalrO   rP   r   
r7   r;   r8   rR   r9   rU   r:   r   r>   rB   
rc   rk   r#   r$   r)   r*   r_   rK   rJ   rE   s
             rL   r   r     s    


UG
,%	\D			4	($
]E


E7
+%55ugsW]]T[TaTaDde'8E,D'5'5#wG&4a#)s?'""$fg?('	.r`   TV_RandomUniform_dtypeTV_RandomUniform_Tc                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S t        j                  |d      }|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 ew xY w)
aL  Outputs random values from a uniform distribution.

  The generated values follow a uniform distribution in the range `[0, 1)`. The
  lower bound 0 is included in the range, while the upper bound 1 is excluded.

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The shape of the output tensor.
    dtype: A `tf.DType` from: `tf.half, tf.bfloat16, tf.float32, tf.float64`.
      The type of the output.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  RandomUniformr#   r$   rk   Nr   r   r   r+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   random_uniform_eager_fallbackr6   r7   r;   r8   r<   r=   r>   r?   r@   rA   rB   r   s                 rL   random_uniformr     s   , 
			0h..0$#\\11otUFD'5g n 

UG
,%	\D			4	($
]E


E7
+%'88uEE"$!QX QK'""$c''/('  )30B0B30GIF ::Lvw8('	.; && -
##At,,## 
*
d%u4TK K## 
r   zraw_ops.RandomUniformc                    t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j
                  t        j                  g      \  }\  } | g}d|d|d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d	|||	       |	\  }	|	S )
Nrk   r   r#   r$   r+   s   RandomUniformrO   rP   r   r   r   s
             rL   r   r     s    


UG
,%	\D			4	($
]E


E7
+%55ugsW]]T[TaTaDde'8E,D'5'5#wG&-q#)s?'""$vw8('	.r`   TV_RandomUniformInt_ToutTV_RandomUniformInt_Tminvalmaxvalc                 j   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 Qw xY w)
a  Outputs random integers from a uniform distribution.

  The generated values are uniform integers in the range `[minval, maxval)`.
  The lower bound `minval` is included in the range, while the upper bound
  `maxval` is excluded.

  The random integers are slightly biased unless `maxval - minval` is an exact
  power of two.  The bias is small for values of `maxval - minval` significantly
  smaller than the range of the output (either `2^32` or `2^64`).

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The shape of the output tensor.
    minval: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      0-D.  Inclusive lower bound on the generated integers.
    maxval: A `Tensor`. Must have the same type as `minval`.
      0-D.  Exclusive upper bound on the generated integers.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor`. Has the same type as `minval`.
  RandomUniformIntr#   r$   Nrj   r   )rc   r   r   r#   r$   r)   Toutr+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   !random_uniform_int_eager_fallbackr6   r7   r8   r<   r=   r>   r?   r@   rA   rB   )rc   r   r   r#   r$   r)   rC   rD   rE   rF   rG   rH   rI   rJ   rK   s                  rL   random_uniform_intr   $  s   : 
			0h..0$#\\11 $vvvtg n 
\D			4	($
]E


E7
+%'88%v!%U?!QX QK'""$c''/(&#2D2DV2L3%%c*,F ::LL&';('	.9 && -
##At,,## 
.
d%dN N## 
s0    D> >FE,,FF	F F21F2zraw_ops.RandomUniformIntc                    |d}t        j                  |d      }|d}t        j                  |d      }t        j                  ||g|t        j                  t        j
                  g      \  }}|\  }}t        j                  | g|t        j                  t        j
                  g      \  }	\  } | ||g}
d|d|d|d|	f}t        j                  dd|
|||      }t        j                         rt        j                  d	|
||       |\  }|S )
Nr   r#   r$   r   r+   s   RandomUniformIntrO   rP   r   )	r7   r8   rR   r9   rU   r:   r   r>   rB   )rc   r   r   r#   r$   r)   r*   
_attr_Tout_inputs_Toutr_   rK   rJ   rE   s                rL   r   r   j  s   	\D			4	($
]E


E7
+%%<<ff=MsU\UbUbdkdqdqTtu*l!6655ugsW]]T[TaTaDde'8E(,D'5&*c7K&0!L#)s?'""$L&';('	.r`   TV_TruncatedNormal_dtypeTV_TruncatedNormal_Tc                    t         j                   xs t        j                         }|j                  }|j                  r!	 t	        j
                  |d|| d|d|d|
      }|S t        j                  |d      }|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 ew xY w)
a  Outputs random values from a truncated normal distribution.

  The generated values follow a normal distribution with mean 0 and standard
  deviation 1, except that values whose magnitude is more than 2 standard
  deviations from the mean are dropped and re-picked.

  Args:
    shape: A `Tensor`. Must be one of the following types: `int32`, `int64`.
      The shape of the output tensor.
    dtype: A `tf.DType` from: `tf.half, tf.bfloat16, tf.float32, tf.float64`.
      The type of the output.
    seed: An optional `int`. Defaults to `0`.
      If either `seed` or `seed2` are set to be non-zero, the random number
      generator is seeded by the given seed.  Otherwise, it is seeded by a
      random seed.
    seed2: An optional `int`. Defaults to `0`.
      A second seed to avoid seed collision.
    name: A name for the operation (optional).

  Returns:
    A `Tensor` of type `dtype`.
  TruncatedNormalr#   r$   rk   Nr   r   r   r+   )r,   r   r-   r.   r   r/   r0   r1   r2   r3   r4   truncated_normal_eager_fallbackr6   r7   r;   r8   r<   r=   r>   r?   r@   rA   rB   r   s                 rL   truncated_normalr     s   . 
			0h..0$#\\11ufdGUg n 

UG
,%	\D			4	($
]E


E7
+%'88e$e $&!QX QK'""$c''/('  )30B0B30GIF ::L<:('	.; && -
##At,,## 
,
d%u4TK K## 
r   zraw_ops.TruncatedNormalc                    t        j                  |d      }|d}t        j                  |d      }|d}t        j                  |d      }t        j                  | g|t        j
                  t        j                  g      \  }\  } | g}d|d|d|d|f}t        j                  dd||||      }	t        j                         rt        j                  d	|||	       |	\  }	|	S )
Nrk   r   r#   r$   r+   s   TruncatedNormalrO   rP   r   r   r   s
             rL   r   r     s    


UG
,%	\D			4	($
]E


E7
+%55ugsW]]T[TaTaDde'8E,D'5'5#wG&/<#)s?'""$<:('	.r`   )r   r   N)N)^__doc__collectionstensorflow.pythonr   tensorflow.python.eagerr   r,   r   r0   r   r7   tensorflow.python.frameworkr   r9   tensorflow.security.fuzzing.pyr   _atypesr	   _op_def_registryr
   r2   r   r<   "tensorflow.python.util.deprecationr   tensorflow.python.utilr   	_dispatch tensorflow.python.util.tf_exportr   typingr   r   r   typing_extensionsr   r   r    r:   Int32intrM   	to_raw_opr(   r5   ra   rb   rm   ri   rl   rq   rr   rx   ru   rw   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r`   rL   <module>r      s  
  6 7 1 7 9 F K 3 I C 8 6 % % '-/ACTVgiw  zI  KZ  \k  m{  }M  O_  aq  sB  C %&C_Vef op|}  ip  iv  iv  }A <	#'7"78 <yQTV]VcVcQcGd <kn <x{ <  Mh <  FO  PS  Up  Pp  Fq <| /i-.~t~~k/JKy6F1F'G V_`celerer`rVs {~   HK   [v   FO  PS  Up  Pp  Fq 0 )00WYkm~  AR  Tb  )c %$+,OQ`bq$r !D)C9Z4Z*[ Ddmnq  tY  oY  eZ D  dm  nq  sX  nX  dY D  dm  nq  sX  nX  dY D  dm  nq  sX  nX  dY D  `c D  mp D  BK  LO  Qv  Lv  Bw DL  Qy)OPQ_QUQ_Q_`~Q   A 3HiCi9j s|  ~A  Ch  ~h  ti   s|  }@  Bg  }g  sh   s|  }@  Bg  }g  sh   s|  }@  Bg  }g  sh   ps   |   OX  Y\  ^C  YC  OD , -P -/@BSUcd <	#'7"78 <3P`K`Aa <hk <ux <  KT  UX  Zj  Uj  Kk <| /i-.~t~~l/KLy6F1F'G PYZ]_oZoPp x{   EH   Xa  be  gw  bw  Xx ( 57HJ[\ %Ys,@'@A %9UXZnUnKo %  @I  JM  Oc  Jc  @d %N 7)56~t~~FW7XYIc;O6O,P Zcdgi}d}Z~   OX  Y\  ^r  Yr  Os  1?OT  !9;LN_aop 1)C);$;< 1IcSiNiDj 1qt 1  B 1  T]  ^a  cy  ^y  Tz 1f 3	12>4>>.3QR38J3J)K S\]`bx]xSy   BE   NQ   aj  kn  pF  kF  aG ( 5X 57HJ[]km|  N  O "#=?PRces  vE  GV  W xy  FG  ho  hu  hu  |@ HYs,@'@A HSVXlSlIm Htw H  BE H  Og H  EN  OR  Tl  Ol  Em HT 7)56~t~~FW7XYIc;O6O,P Xabeg{b{X|   EH   QT   ]u   EN  OR  Tl  Ol  Em 0   H
 ;)C);$;< ;3 ;PS ;enor  uG  pG  fH ;z 3	12>4>>.3QR38J3J)K SV _b r{|  BT  }T  sU & !((GI[]n  qB  DR  !S #$?Rab :)C1J,J"K :Tq :x{ :  FI :  [d  eh  jG  eG  [H :x Ay!?@PfAgh 3@Y;Y1Z   dA   IL   UX   hq  ru  wT  rT  hU ( !!9;MO`bs  vD  E 1?OT ;)C);$;< ;E[ ;be ;or ;  EN  OR  Tj  Oj  Ek ;z 3	12>4>>.3QR38J3J)K Tj ru   B   R[  \_  aw  \w  Rx ( ##=P_`  7/Z Ai-B(BC AYWZ\tWtMu A  @I  JM  Og  Jg  @h A  or A  | A  QZ  [^  `x  [x  Qy AF 9978HZ9[\ Ys<Q7Q-R \efi  lD  gD  ]E   OX  Y\  ^v  Yv  Ow   B   KN   ^g  hk  mE  hE  ^F * ##=?QSdfw  zH  I 5X <Ic+?&?@ <Ia <hk <ux <  KT  UX  Zr  Ur  Ks <| 7)56~t~~FV7WX9S:N5N+O Xp x{   EH   Xa  be  g  b  X@ r`   