a
    ¢º”h»  ã                   @   sZ   d dl Z d dlmZ d dlmZmZ dgZeegef eeedf  ee	 dœdd„Z
dS )é    N)ÚIterable)ÚAnyÚCallableÚtrace_dependencies.)ÚcallableÚinputsÚreturnc              	      sR   t ƒ ‰ ‡ fdd„}z*t |¡ |D ]}| |Ž  q"W t d¡ nt d¡ 0 tˆ ƒS )a¾  Trace the execution of a callable in order to determine which modules it uses.

    Args:
        callable: The callable to execute and trace.
        inputs: The input to use during tracing. The modules used by 'callable' when invoked by each set of inputs
            are union-ed to determine all modules used by the callable for the purpooses of packaging.

    Returns: A list of the names of all modules used during callable execution.
    c                    s„   |dkrd S | j j}d }|| jv r0| j| j}nB|| jv rH| j| j}n*d| jv rrt| jd |d ƒ}|rn|jnd }|r€ˆ  |¡ d S )NÚcallÚself)Úf_codeÚco_nameÚ	f_globalsÚ
__module__Úf_localsÚgetattrÚadd)ÚframeÚeventÚargÚnameÚmoduleÚmethod©Zmodules_used© úV/var/www/auris/lib/python3.9/site-packages/torch/package/analyze/trace_dependencies.pyÚrecord_used_modules   s    	


z/trace_dependencies.<locals>.record_used_modulesN)ÚsetÚsysÚ
setprofileÚlist)r   r   r   Úinpr   r   r   r   
   s    
)r   Úcollections.abcr   Útypingr   r   Ú__all__Útupler   Ústrr   r   r   r   r   Ú<module>   s   þ