
    i0                     :   S SK JrJrJrJrJr  S SKrS SKJs  J	s  J
s  Jr  S SKrS SKJr  S SKJr  S SKJr  S SKJrJr  S SKJr  S SKJr  S S	KJr   " S
 S\R<                  5      r " S S\R>                  5      r " S S\R@                  5      r  " S S\5      r!g)    )AnyListOptionalSequenceTupleN)Tester)	StageType)VulkanPartitioner)!get_symmetric_quantization_configVulkanQuantizer)EdgeCompileConfig)Partitioner)	Quantizerc                   l   ^  \ rS rSr     S
S\\   S\S-  S\S\\\      S\\   4
U 4S jjjr	S	r
U =r$ )Quantize   N	quantizerquantization_config	calibratecalibration_samplesis_qatc                 l   > [         TU ]  U=(       d
    [        5       U=(       d
    [        5       UUUS9  g )N)r   r   r   r   r   )super__init__r   (get_symmetric_quantization_config_vulkan)selfr   r   r   r   r   	__class__s         e/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/executorch/backends/vulkan/test/tester.pyr   Quantize.__init__   s7     	4?#4#Q'O'Q 3 	 	
     )NNTNF)__name__
__module____qualname____firstlineno__r   r   r   boolr   r   __static_attributes____classcell__r   s   @r   r   r      sd     *.*.7;!&
I&
 !4Z
 	

 &hsm4
 
 
r    r   c                   :   ^  \ rS rSrSS\\   4U 4S jjjrSrU =r$ )	Partition-   partitionerc                 L   > SS0n[         TU ]  U=(       d    [        U5      S9  g )Nskip_bool_tensorsT)r-   )r   r   r
   )r   r-   vk_compile_specr   s      r   r   Partition.__init__.   s-    .5#I'8'I 	 	
r    r!   N)	r"   r#   r$   r%   r   r   r   r'   r(   r)   s   @r   r+   r+   -   s    
H[$9 
 
r    r+   c                   N   ^  \ rS rSr  SS\\\      S\\   4U 4S jjjrSr	U =r
$ )ToEdgeTransformAndLower5   partitionersedge_compile_configc                 r   > Uc  SS0n[        U5      /n[        TU ]	  [         UU=(       d	    [        SS9S9  g )Nr/   TF)_check_ir_validity)default_partitioner_clsr6   r7   )r
   r   r   r   )r   r6   r7   r0   r   s       r   r    ToEdgeTransformAndLower.__init__6   sJ    
 2D9O-o>?L$5% 3 !; E:	 	 	
r    r!   )NN)r"   r#   r$   r%   r   r   r   r   r   r'   r(   r)   s   @r   r4   r4   5   s7     59;?
tK01
 &&78
 
r    r4   c            	          ^  \ rS rSr SS\R
                  R                  S\\R                     S\	\\
      4U 4S jjjrSrU =r$ )VulkanTesterG   moduleexample_inputsdynamic_shapesc                    > [         R                  R                  R                  R                  R                  5       [        R                  [        [        R                  [        0-  n[        TU ]1  UUUUS9  g )N)r?   stage_classesr@   rA   )
executorchbackendstestharnessr   default_stage_classesr	   	PARTITIONr+   TO_EDGE_TRANSFORM_AND_LOWERr4   r   r   )r   r?   r@   rA   rC   r   s        r   r   VulkanTester.__init__H   so     $$,,33IIK##Y557N 	 	'))	 	 	
r    r!   r2   )r"   r#   r$   r%   torchnnModuler   Tensorr   r   r   r'   r(   r)   s   @r   r=   r=   G   sH    
 04	

 ell+
 !s,	
 
r    r=   )"typingr   r   r   r   r   rD   'executorch.backends.test.harness.stagesrE   rF   rG   stages
BaseStagesrL    executorch.backends.test.harnessr   
TesterBaser	   9executorch.backends.vulkan.partitioner.vulkan_partitionerr
   5executorch.backends.vulkan.quantizer.vulkan_quantizerr   r   r   executorch.exirr   #executorch.exir.backend.partitionerr   #torchao.quantization.pt2e.quantizerr   r   r+   r4   r=   r!   r    r   <module>r[      st    8 7  < <  A = W . ; 9
z"" 
(

$$ 

j@@ 
$
: 
r    