U
    ‰dZ  ã                   @   s:   d dl Z d dlZd dlZe ¡ ae jdd„ ƒZdd„ ZdS )é    Nc                 k   s~   t | tƒs t| ƒstdƒ‚| g} t tƒ ¡}| D ]<}t|ƒsDtdƒ‚|j}||kr\i tj	|< tj	|  
|¡ q0d V  |t_	d S )NzBarg_scope is only supporting single or a list of helper functions.zAarg_scope is only supporting a list of callable helper functions.)Ú
isinstanceÚlistÚcallableÚAssertionErrorÚcopyÚdeepcopyÚget_current_scopeÚ__name__Ú_threadlocal_scopeÚcurrent_scopeÚupdate)Zsingle_helper_or_listÚkwargsZ	old_scopeÚhelperZ
helper_key© r   úC/tmp/pip-unpacked-wheel-ua33x9lu/caffe2/python/helpers/arg_scope.pyÚ	arg_scope   s     

ÿ
ÿ
r   c                   C   s   t tdƒsi t_tjS )Nr   )Úhasattrr
   r   r   r   r   r   r      s    
r   )Ú
contextlibr   Ú	threadingÚlocalr
   Úcontextmanagerr   r   r   r   r   r   Ú<module>   s   
