U
    9%e                      @   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'ej(d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 ZGddd hZHeId!d"JeKejLeH d#ZMd$d% ZNeOd&d'd(ZPd3d*d+ZQd,D ]ZRePeR qReN  d-d. ZSe	Tdd/d0 ZUd1d2 ZVdS )4    N   )comptimeconfigexternal_utilsc                 C   s   t dd| S )Nz__init__.py$ )resub)s r
   V/var/www/html/Darija-Ai-API/env/lib/python3.8/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.configztorchrec/distributedztorchrec/fb/distributedz5caffe2/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$ttj	| }|s8d S |j
}|d krJd S tt| t  d S r   )
isinstancetypes
ModuleTypeadd__name__strAssertionError	importlibutil	find_specoriginr    appendr   r"   )r#   Zmodule_specr.   r
   r
   r   r'      s    
r'   Fc                 C   sL   | dkrdS | t k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!   )filenameZallow_torchr
   r
   r   check   s    r7   )Z	functorchZ
fx2trt_ossZintel_extension_for_pytorchZnetworkxnumpyZ	omegaconfZonnxZonnxruntimeZonnx_tfZpandasZsklearntabulateZ
tensorflowZtensorrtZ	torch2trtZtqdmtreeZtvmZxarrayc                    s   t  fddtjD S )Nc                 3   s   | ]}  t|V  qd S r   )
startswithr   )r   modr6   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    rB   c                 C   s   |  t rdS |  ttS )NF)r;   rB   r   rA   r=   r
   r
   r   r1     s    r1   )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%   typingZunittestweakrefrA   Ztorch._inductor.test_operatorsZtorch.distributedZtorch.utils._content_storer   r   r   r   r   r&   r   pathdirnamer   r    nnZ
Sequential__init____code__co_filenameZset_rng_stateZ	_inductorZtest_operatorsutilsZ_content_storer0   distributedZis_availableZ;torch.distributed.algorithms._checkpoint.checkpoint_wrapperZ
algorithmsZ_checkpointZcheckpoint_wrapperZoptim__dict__valuesZ_functionalZ_foreach_utilssetr!   import_moduler2   ZFBCODE_SKIP_DIRSr   r   r   r   r4   r"   r)   r'   r7   _namer@   	lru_cacherB   r1   r
   r
   r
   r   <module>   s  -













 

