B
    Ð»ˆd’  ã               @   s6   d Z ddlZddlZddlmZ G dd„ dejƒZdS )zA LazyLoader class.é    N)Ú
tf_loggingc                   s:   e Zd ZdZd‡ fdd„	Zdd„ Zdd„ Zd	d
„ Z‡  ZS )Ú
LazyLoaderzßLazily import a module, mainly to avoid pulling in large dependencies.

  `contrib`, and `ffmpeg` are examples of modules that are large and not always
  needed, and this allows them to only be loaded when they are used.
  Nc                s&   || _ || _|| _tt| ƒ |¡ d S )N)Ú_local_nameÚ_parent_module_globalsÚ_warningÚsuperr   Ú__init__)ÚselfÚ
local_nameÚparent_module_globalsÚnameÚwarning)Ú	__class__© úT/var/www/html/venv/lib/python3.7/site-packages/tensorflow/python/util/lazy_loader.pyr      s    zLazyLoader.__init__c             C   sB   t  | j¡}|| j| j< | jr0t | j¡ d| _| j 	|j¡ |S )z8Load the module and insert it into the parent's globals.N)
Ú	importlibÚimport_moduleÚ__name__r   r   r   Úloggingr   Ú__dict__Úupdate)r	   Úmoduler   r   r   Ú_load&   s    zLazyLoader._loadc             C   s   |   ¡ }t||ƒS )N)r   Úgetattr)r	   Úitemr   r   r   r   Ú__getattr__9   s    zLazyLoader.__getattr__c             C   s   |   ¡ }t|ƒS )N)r   Údir)r	   r   r   r   r   Ú__dir__=   s    zLazyLoader.__dir__)N)	r   Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Ú__classcell__r   r   )r   r   r      s
   r   )r    r   ÚtypesÚtensorflow.python.platformr   r   Ú
ModuleTyper   r   r   r   r   Ú<module>   s   