o
    h                      @   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d dl Zd dl!Zd dl"Zddl#m$Z$m%Z%m&Z& 	 dd Z'dej(fddZ)e)eej*+e,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  Z-ej.j/j0j1j2ej3j1j2ej4j5j,ej6j7j,e&j,e$j,hZ8ej9: rd dl;Ze8ej9j<j=j>j,hO Z8e8dd ej?j@A D O Z8e8ej?jBj,hO Z8e8ej6jCj,hO Z8e8e)ed e)ed e)ed e)ed hO Z8e8e)ed hO Z8e8eDe

e)ed e)ed hB O Z8e8e)ed e)ed hO Z8e8e)ed e)ed e)ed e)ed hO Z8daEeFdG ZGh dZHeIdd JeKejLeH d!ZMd"d# ZNd$eOfd%d&ZPd1d(d)ZQd*D ]ZRePeR qeN  d+d, ZSe	Tdd-d. ZUd/d0 ZVdS )2    N   )comptimeconfigexternal_utilsc                 C   s   t dd| S )Nz__init__.py$ )resub)s r
   M/var/www/html/ai/venv/lib/python3.10/site-packages/torch/_dynamo/skipfiles.py_strip_init_py9   s   r   mc                 C   s
   t | jS N)r   __file__)r   r
   r
   r   _module_dir=   s   
r   /z<frozen importlibz<__array_function__ internals>c                 C   s   g | ]}t |qS r
   )r   ).0r   r
   r
   r   
<listcomp>H   s    r   c                 C   s    h | ]}t |rt |qS r
   )inspectisclassgetfile)r   objr
   r
   r   	<setcomp>   s    r   z!ao/quantization/pt2e/qat_utils.pyz.ao/quantization/quantizer/xnnpack_quantizer.pyz.ao/quantization/pt2e/representation/rewrite.pyzao/quantization/pt2e/utils.pyz_export/constraints.pyz_export/db/examples/*.pyz_export/wrappers.pyz_functorch/apis.pyz_functorch/deprecated.pyz%distributed/tensor/parallel/_utils.pyz$distributed/tensor/parallel/style.pyzdistributed/_tensor/api.pyz"distributed/_tensor/device_mesh.pyztorch._inductor.config>   torchrec/distributedtorchrec/fb/distributed5caffe2/torch/fb/sparsenn/pooled_embeddings_modules.pyz.*(|)c                   C   s$   t ddtt jt dad S )Nz^(r   r   )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| }|sd S |j	}|d u r%d S t
t| t  d S r   )
isinstancetypes
ModuleTypeadd__name__str	importlibutil	find_specoriginr"   appendr   r$   )r%   module_specr/   r
   r
   r   r)      s   

r)   Fc                 C   sL   | du rdS | t v rdS |rt| rdS trtt| rdS tt| S )zShould skip this file?NTF)FILENAME_ALLOWLISTis_torch	is_fbcodeboolFBCODE_SKIP_DIRS_REmatchr#   )filenameallow_torchr
   r
   r   check   s   r:   )	functorch
fx2trt_ossintel_extension_for_pytorchnetworkxnumpy	omegaconfonnxonnxruntimeonnx_tfpandassklearntabulate
tensorflowtensorrt	torch2trttqdmtreetvmxarrayc                    s   t  fddtjD S )Nc                 3   s    | ]
}  t|V  qd S r   )
startswithr   )r   modr8   r
   r   	<genexpr>   s
    
z*is_torch_inline_allowed.<locals>.<genexpr>)anyr   !skipfiles_inline_module_allowlistrP   r
   rP   r   is_torch_inline_allowed   s   rT   c                  C   s   dd l } t| jS )Nr   )torch._dynamor   _dynamo)torchr
   r
   r   
dynamo_dir   s   
rX   c                 C   s   |  t rdS |  ttS )NF)rN   rX   r   rW   rP   r
   r
   r   r3     s   r3   )F)W_collections_abc_weakrefsetabccollections
contextlibcopycopyregdataclassesenum	functoolsglobr,   r   	linecacheloggingmultiprocessingoperatoros	posixpathrandomr   	selectorssignaltempfile	threadingtokenize	tracebackr'   typingunittestweakrefrW   torch._inductor.test_operatorstorch.distributedtorch.utils._content_storer   r   r   r   r   r(   r   pathdirnamer   r"   nn
Sequential__init____code__co_filenameset_rng_state	_inductortest_operatorsutils_content_storer2   distributedis_available;torch.distributed.algorithms._checkpoint.checkpoint_wrapper
algorithms_checkpointcheckpoint_wrapperoptim__dict__values_functional_foreach_utilssetr#   import_moduler4   FBCODE_SKIP_DIRSr   r   r    r!   r6   r$   r+   r)   r:   _namerT   	lru_cacherX   r3   r
   r
   r
   r   <module>   s   -













 

