o

    hl                     @   sn   d dl Zd dlZd dlmZ d dlZd dlmZ defddZ	dd Z
e
d	Ze
d
Ze
dZ
e
dZe
ZdS )
    N)repeat)
digit_versionreturnc                  C   sD   t tjt dkrtj } t| tr| S tj S t	
dt dS )Nz1.6.0ztorch.jit.is_tracing is only supported after v1.6.0. Therefore is_tracing returns False automatically. Please set on_trace manually if you are using trace.F)r   torch__version__jit
is_tracing
isinstancebool_C_is_tracingwarningswarnUserWarning)Zon_trace r   1/root/Awesome-Backbones/configs/common/helpers.pyr   
   s   


r   c                    s    fdd}|S )Nc                    s    t | tjjr	| S tt|  S )N)r	   collectionsabcIterabletupler   )xnr   r   parse   s   z_ntuple.<locals>.parser   )r   r   r   r   r   _ntuple   s   r               )collections.abcr   r
   	itertoolsr   r   utils.version_utilsr   r
   r   r   	to_1tuple	to_2tuple	to_3tuple	to_4tuple	to_ntupler   r   r   r   <module>   s   
