o
    X۷i                     @  s  d dl mZ d dlZd dlZd dlmZ dd Z	d>ddZ
dd	 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 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& 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/m0Z0 d d-l/m1Z1 d d.l/m2Z2 d d/l/m3Z3 d d0l/m4Z4 d d1l5m6Z6 d d2l5m7Z7 d d3l8m9Z9 d d4l8m:Z: d d5l8m;Z; d d6l8m<Z< d d7l8m=Z= d d8l8m>Z> d d9l8m?Z? d d9l8m?Z@ d d9l8m?ZA d d9l8m?ZB d d:lCmDZD d d;lCmEZE d d<lCmFZF d d=lCmGZG dS )?    )annotationsN)runtimec                 C  s   t j| S )a  Returns random bytes.

    .. note:: This function is just a wrapper for :obj:`numpy.random.bytes`.
        The resulting bytes are generated on the host (NumPy), not GPU.

    .. seealso:: :meth:`numpy.random.bytes
                 <numpy.random.mtrand.RandomState.bytes>`
    )_numpyrandombytes)length r   J/home/ubuntu/vllm_env/lib/python3.10/site-packages/cupy/random/__init__.pyr   	   s   
r   c                 C  sb   ddl m} tjrttt dd dk rtdt| t	r$|| S t| |r+| S |t
| S )a  Construct a new Generator with the default BitGenerator (XORWOW).

    Args:
        seed (None, int, array_like[ints], numpy.random.SeedSequence, cupy.random.BitGenerator, cupy.random.Generator, optional):
            A seed to initialize the :class:`cupy.random.BitGenerator`. If an
            ``int`` or ``array_like[ints]`` or None is passed, then it will be
            passed to :class:`numpy.random.SeedSequence` to detive the initial
            :class:`BitGenerator` state. One may also pass in a `SeedSequence
            instance. Adiditionally, when passed :class:`BitGenerator`, it will
            be wrapped by :class:`Generator`. If passed a :class:`Generator`,
            it will be returned unaltered.

    Returns:
        Generator: The initialized generator object.
    r   )	GeneratorN   i  zRGenerator API not supported in ROCm<4.3, please use the legacy one or update ROCm.)cupy.random._generator_apir
   _runtimeis_hipintstrruntimeGetVersionRuntimeError
isinstanceBitGeneratorXORWOW)seedr
   r   r   r	   default_rng   s   "

r   c                 C  s<   | dkrdd l }|jjj}|tj_|S tdt d|  d)Nr
   r   zmodule 'z' has no attribute '')r   r   _generator_apir
   _cupyAttributeError__name__)keycupyr
   r   r   r	   __getattr__2   s   
r   )beta)binomial)	chisquare)	dirichlet)exponential)f)gamma)	geometric)gumbel)hypergeometric)laplace)logistic)	lognormal)	logseries)multivariate_normal)negative_binomial)noncentral_chisquare)noncentral_f)normal)pareto)poisson)power)rayleigh)standard_cauchy)standard_exponential)standard_gamma)standard_normal)
standard_t)
triangular)uniform)vonmises)wald)weibull)zipf)get_random_state)RandomState)reset_states)r   )set_random_state)permutation)shuffle)choice)multinomial)rand)randint)randn)random_integers)random_sample)r   )r   )MRG32k3a)Philox4x3210)N)H
__future__r   numpyr   r   r   cupy_backends.cuda.apir   r   r   r   r   cupy.random._distributionsr    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   cupy.random._generatorrB   rC   rD   r   rE   cupy.random._permutationsrF   rG   cupy.random._samplerH   rI   rJ   rK   rL   rM   rN   r   ranfsamplecupy.random._bit_generatorr   r   rO   rP   r   r   r   r	   <module>   s|    
