a
    d                      @   s  d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZz@d dl Zd dl!Zd dl"Zd dl#Zd dl$Zd dl%Zd dl&ZdZ'W n e(yX   dZ'Y n0 ddl)m*Z*m+Z+m,Z, dd Z-ej.dd	d
Z/e/eej01e2d ddgdd eeeeeeee	e
eeeeeeeeeeeeeeeeeeee efD  Z3ej4j5j6j7j8ej9j7j8ej:j;j2e,j2e*j2hZ<e<dd ej=j>? D O Z<e<ej=j@j2hO Z<e'rze<ejAj2ejAjBj2ejAjCj2ejDj2ejDjEj2ejDj4jFj2hO Z<daGdd ZHeIdddZJd ddZKdD ]ZLeJeL qeH  dd ZMe	Nddd ZOdd ZPdS )!    NTF   )comptimeconfigexternal_utilsc                 C   s   t dd| S )Nz__init__.py$ )resub)s r
   `/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/torch/_dynamo/skipfiles.py_strip_init_pyG   s    r   mc                 C   s
   t | jS N)r   __file__r   r
   r
   r   _module_dirK   s    r   /z<frozen importlibz<__array_function__ internals>c                 C   s   g | ]}t |qS r
   )r   ).0r   r
   r
   r   
<listcomp>V   s   r   c                 C   s    h | ]}t |rt |qS r
   )inspectisclassgetfile)r   objr
   r
   r   	<setcomp>   s   
r   c                   C   s$   t ddtt jt dad S )Nz^(|))r   compilejoinmapescape	SKIP_DIRSSKIP_DIRS_REr
   r
   r
   r   _recompile_re   s    r"   )import_namec                 C   sb   t | tjrt| jS t | ts$J tj| }|s8d S |j	}|d u rJd S t
t| t  d S r   )
isinstancetypes
ModuleTypeadd__name__str	importlibutil	find_specoriginr    appendr   r"   )r#   Zmodule_specr-   r
   r
   r   r'      s    
r'   c                 C   s6   | du rdS | t v rdS |r(t| r(dS tt| S )zShould skip this file?NTF)FILENAME_ALLOWLISTis_torchboolr!   match)filenameZallow_torchr
   r
   r   check   s    r4   )Z	functorchZintel_extension_for_pytorchZnetworkxnumpyZ	omegaconfZonnxZonnxruntimeZonnx_tfZpandasZsklearntabulateZ
tensorflowZtensorrtZ	torch2trtZtqdmtreeZtvmZ
fx2trt_ossZxarrayc                    s   t  fddtjD S )Nc                 3   s   | ]}  t|V  qd S r   )
startswithr   )r   modr3   r
   r   	<genexpr>   s   z*is_torch_inline_allowed.<locals>.<genexpr>)anyr   Z!skipfiles_inline_module_allowlistr:   r
   r:   r   is_torch_inline_allowed   s    r=   c                  C   s   dd l } t| jS )Nr   )Ztorch._dynamor   Z_dynamo)torchr
   r
   r   
dynamo_dir   s    r?   c                 C   s   |  t rdS |  ttS )NF)r8   r?   r   r>   r:   r
   r
   r   r0      s    r0   )F)Q_collections_abc_weakrefsetabccollections
contextlibcopycopyregZdataclassesenum	functoolsr*   r   	linecacheloggingmultiprocessingoperatoros	posixpathrandomr   	selectorssignaltempfile	threadingtokenize	tracebackr%   typingZunittestweakrefr>   Ztorch._inductor.test_operatorsZtorch._primsZtorch._prims.utilsZtorch._prims.wrappersZtorch._refsZtorch._refs.nnZtorch._refs.nn.functionalZtorch._refs.specialZHAS_PRIMS_REFSImportErrorr   r   r   r   r   r&   r   pathdirnamer   r    nnZ
Sequential__init____code__co_filenameZset_rng_stateZ	_inductorZtest_operatorsr/   Zoptim__dict__valuesZ_functionalZ_primsutilswrappersZ_refsZspecialZ
functionalr!   r"   r)   r'   r4   _namer=   	lru_cacher?   r0   r
   r
   r
   r   <module>   s   
-





