+
    &j                        R t ^ RIHt ^ RIt^ RIHt ^ RIt^RIHtH	t	 ^RI
HtHtHt . ROtR tR t]RR l4       t]RR	 l4       tR
 t]t]t]RR l4       t]R 4       t]RR l4       t]R 4       t]RR l4       t]]RR R ll4       4       tR# )zWrapper to mimic (parts of) np.random API surface.

NumPy has strict guarantees on reproducibility etc; here we don't give any.

Q: default dtype is float64 in numpy

)annotationsN)sqrt)_dtypes_impl_util)array_or_scalar	ArrayLike
normalizerc                 ,    ^ RI Hu Hp  V P                  # )    N)torch._dynamo.config_dynamoconfiguse_numpy_random_stream)r   s    k/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/torch/_numpy/random.pyuse_numpy_randomr   %   s    )))))    c                F   a  \         P                  ! S 4      V 3R  l4       pV# )c            	       <a \        4       '       g	   S! V / VB # ^ RIp^RIHo \	        VP
                  SP                  4      p\        ;QJ d    . V3R lV  4       F  NK  	  5M! V3R lV  4       4      p VP                  4        UUu/ uF4  w  rET\        VS4      '       d   VP                  P                  4       MTbK6  	  pppV! V / VB p\        WbP                  4      '       d   S! \        P                  ! V4      4      pV# u uppi )r
   Nndarrayc              3     <"   T F3  p\        VS4      '       d   VP                  P                  4       MTx  K5  	  R # 5iN)
isinstancetensornumpy).0argr   s   & r   	<genexpr>-deco_stream.<locals>.inner.<locals>.<genexpr>9   s3      SWCjg&>&>

  "CGSWs   ;>)r   r   _ndarrayr   getattrrandom__name__tupleitemsr   r   torch	as_tensor)	argskwdsr   fkeyvalvaluer   funcs	   *,     @r   innerdeco_stream.<locals>.inner-   s    !!&&&)dmm4A 5 SW55 SW D
 !%

 ,HC :c7+C+CSZZ%%'L ,  
 t$t$E %// 67Ls   
:D)	functoolswraps)r-   r.   s   f r   deco_streamr2   ,   s%    __T 6 Lr   c                P    V e"   \         P                  P                  V 4       R # R # r   )r%   r!   manual_seed)seeds   &r   r5   r5   L   s      & r   c                    V f   Rp \         P                  ! 4       P                  p\        P                  ! WR7      P                  4       p\        W R8H  R7      # Ndtypereturn_scalar r   default_dtypesfloat_dtyper%   emptyuniform_r   sizer9   valuess   &  r   random_samplerE   R   sF    |'')55E[[+446F6<<r   c                 *    V R8X  d   R p \        V 4      # )Nr<   )rE   rC   s   *r   randrH   [   s    rzr   c                    Vf   Rp\         P                  ! 4       P                  p\        P                  ! W#R7      P                  W4      p\        WBR8H  R7      # r7   r=   )lowhighrC   r9   rD   s   &&&  r   uniformrL   e   sH    |'')55E[[+44S?F6<<r   c                     \         P                  ! 4       P                  p\        P                  ! WR 7      p\        W R8H  R7      # )r8   r:   r<   )r   r>   r?   r%   randnr   rB   s   *  r   rN   rN   n   s3    '')55E[[+F6<<r   c                    Vf   Rp\         P                  ! 4       P                  p\        P                  ! W#R7      P                  W4      p\        WBR8H  R7      # r7   )r   r>   r?   r%   r@   normal_r   )locscalerC   r9   rD   s   &&&  r   normalrS   u   sH    |'')55E[[+33C?F6<<r   c                *   ^RI Hp \        V \        P                  4      '       d   T pM)\        W4      '       d   V P
                  pM\        R4      h\        P                  ! VP                  ^ ,          4      pW#,          pVP                  V4       R# )   r   z'We do not random.shuffle lists in-placeN)
r   r   r   r%   Tensorr   NotImplementedErrorrandpermshapecopy_)xr   r   permxps   &    r   shuffler^   ~   sf     "!U\\""	A		!"KLL>>&,,q/*D	B
LLr   c                    Vf   Rp\        V\        \        34      '       g   V3pVf   ^ T r\        P                  ! WVR7      p\        V\        VR8H  R7      # )NrG   r:   r<   )r   r#   listr%   randintr   int)rJ   rK   rC   rD   s   &&& r   ra   ra      sS    |dUDM**w|sT]]340F63dbjAAr   c                    V ^8  d   QhRRRR/# )   ar   pzArrayLike | Noner<   )formats   "r   __annotate__rh      s     " "i "5E "r   c                   V P                  4       ^8X  d   \        P                  ! V 4      p Vf   ^pM2\        P                  ! V4      '       d   ^pV F  pWE,          pK  	  MTpVf/   \        P
                  ! V 4      V P                  ^ ,          ,          p\        \        P                  ! VP                  4      P                  4      p\        VP                  4       R,
          4      V8  d   \        R4      h\        P                  ! W4VR7      p\        P                  ! V4      '       d   VP                  V4      pW,          pV# )rU         ?zprobabilities do not sum to 1.)replacement)numelr%   aranger   is_sequence	ones_likerY   r   finfor9   epsabssum
ValueErrormultinomialreshape)	re   rC   replacerf   num_elelatolindicessampless	   &&&&     r   choicer}      s     	wwyA~LLO
 |			4	 	 BLF   	yOOA+ AGG$(()D
1557S=D 9:: w?G//$'jGNr   )r5   rE   sampler!   rH   rN   rS   r}   ra   r^   rL   r   )g        rj   N)NN)NTN)__doc__
__future__r   r0   mathr   r%    r   r   _normalizationsr   r   r   __all__r   r2   r5   rE   rH   r~   r!   rL   rN   rS   r^   ra   r}   r<   r   r   <module>r      s    #    ! C C*@ ' '
 = = 
	 = = = = = =    B B "  "r   