3
I4W^Ä  ã               @   s^   d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZejƒ aej	dd„ ƒZ
dd„ ZdS )	é    )Úabsolute_import)Údivision)Úprint_functionNc             k   s‚   t | tƒs t| ƒstdƒ‚| g} tjtƒ ƒ}xD| D ]<}t|ƒsFtdƒ‚|j}||kr^i tj	|< tj	| j
|ƒ q2W d 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   ú@/tmp/pip-build-e66j97b2/torch/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   )Ú
__future__r   r   r   Ú
contextlibr	   Ú	threadingÚlocalr   Úcontextmanagerr   r   r   r   r   r   Ú<module>   s   