U
    ªÊ¹j÷  ã                    @   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/bwave/python/venv/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  úâýù-ù
ÿ
þ



ü
ÿÿ
ÿþ

þ



üý 

