o
    Zh                     @   s   d dl Z d dlmZ dadd Zdd Zedd	 ZG d
d dZG dd de jZ	d dl
mZmZmZmZmZmZmZmZmZmZmZmZ dS )    N)contextmanagerTc                   C   s   da d S )NF"__allow_nonbracketed_mutation_flag r   r   F/var/www/auris/lib/python3.10/site-packages/torch/backends/__init__.pydisable_global_flags   s   r   c                   C   s   t  S Nr   r   r   r   r   flags_frozen   s   r	   c                  c   s"    t } da zd V  W | a d S | a w )NTr   )oldr   r   r   __allow_nonbracketed_mutation   s   r   c                   @   s$   e Zd Zdd Zdd Zdd ZdS )ContextPropc                 C   s   || _ || _d S r   )gettersetter)selfr   r   r   r   r   __init__"   s   
zContextProp.__init__c                 C   s   |   S r   )r   )r   objobjtyper   r   r   __get__&   s   zContextProp.__get__c                 C   s&   t  s
| | d S td|j d)Nznot allowed to set zM flags after disable_global_flags; please use flags() context manager instead)r	   r   RuntimeError__name__)r   r   valr   r   r   __set__)   s
   zContextProp.__set__N)r   
__module____qualname__r   r   r   r   r   r   r   r   !   s    r   c                       s$   e Zd Z fddZdd Z  ZS )
PropModulec                    s   t  | || _d S r   )superr   m)r   r   name	__class__r   r   r   4   s   
zPropModule.__init__c                 C   s   | j |S r   )r   __getattribute__)r   attrr   r   r   __getattr__8   s   zPropModule.__getattr__)r   r   r   r   r"   __classcell__r   r   r   r   r   3   s    r   )cpucudacudnn
cusparseltkleidiaimhamklmkldnnmpsnnpackopenmp	quantized)types
contextlibr   r   r   r	   r   r   
ModuleTyper   Ztorch.backendsr$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r   r   r   r   <module>   s   

<	