o
    MeO  ã                   @   s8   d Z ddlmZ ddlmZ dgZG dd„ dejƒZdS )z|This is definition of generator class, which is for managing the state of the algorithm that produces pseudo random numbers.é   )Úcore)Ú_get_paddle_placeÚ	Generatorc                       s"   e Zd ZdZd‡ fdd„	Z‡  ZS )r   zGenerator classNc                    s@   t |ƒ| _|st ¡ }t|tjƒrtt| ƒ ¡  dS td| ƒ‚)aö  
        Create a generator object which manages the random number generation. ( Experimental Feature )

        Parameters:
            place(CPUPlace|CUDAPinnedPlace|CUDAPlace|str,optional): The place to allocate Tensor. Can be  
                CPUPlace, CUDAPinnedPlace, CUDAPlace. Default: None, means global place. If ``place`` is
                string, it can be ``cpu`` and ``gpu:x``, where ``x`` is the index of the GPUs.

        Returns:
            Generator: A generator object.

        zbGenerator class with %s does is not supported yet, currently only support generator with CPUPlace N)	r   Úplacer   ZCPUPlaceÚ
isinstanceÚsuperr   Ú__init__Ú
ValueError)Úselfr   ©Ú	__class__© úFD:\Projects\ConvertPro\env\Lib\site-packages\paddle/fluid/generator.pyr      s   
ÿÿzGenerator.__init__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r   r   r   r   r      s    N)r   Ú r   Z	frameworkr   Ú__all__r   r   r   r   r   Ú<module>   s
   