
    i                     l    S SK JrJr  S SKJrJrJr  S SKJr  S SK	J
r
  S SKJr  \ " S S\5      5       rg)	    )finalList)BackendDetailsExportedProgramPreprocessResult)CompileSpec)DimOrderOpsRevertPass)openvino_compilec                   :    \ rS rSr\S\S\\   S\4S j5       r	Sr
g)OpenvinoBackend   edge_programmodule_compile_specreturnc                 <   [        5       " UR                  5      nU(       a"  UR                  (       a  UR                  Ul        UR                  R                  n/ nUR
                  R                   H3  nUR                  U;   d  M  UR                  UR                  S   5        M5     0 nU H)  nUR                  R                  5       XxR                  '   M+     [        UR                  5       /UQ7SU06n	U	R                  5       n
[!        U
R#                  5       S9$ )an  
Preprocesses the exported program and compiles it for the OpenVINO backend.

Args:
    edge_program (ExportedProgram): The exported program representing the model.
    module_compile_spec (List[CompileSpec]): A list of compile specifications for the OpenVINO backend.

Returns:
    PreprocessResult: The result of preprocessing, including the compiled model bytes.
valoptions)processed_bytes)r	   graph_module_graph_modulegraph_signatureuser_inputsgraphnodestargetappendmetavaluedecodekeyr
   moduleexport_modelr   getvalue)clsr   r   transformed_epinput_namesargsnodecompile_optionsspeccompiledmodel_bytess              f/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/executorch/backends/openvino/preprocess.py
preprocessOpenvinoBackend.preprocess   s     /01J1JK n99)7)D)DL&"22>> &&,,D{{k)DIIe,- - 'D(,

(9(9(;OHH% ( $!
$(
2A
 ++-0D0D0FGG     N)__name__
__module____qualname____firstlineno__classmethodr   r   r   r   r.   __static_attributes__r1   r0   r-   r   r      s8     "H*"HAEkAR"H	"H "Hr0   r   N)typingr   r   'executorch.exir.backend.backend_detailsr   r   r   +executorch.exir.backend.compile_spec_schemar   -executorch.exir.passes.memory_format_ops_passr	   -openvino.frontend.pytorch.torchdynamo.compiler
   r   r1   r0   r-   <module>r=      s@     
 D O
 %Hn %H %Hr0   