
    iU                     :   S SK r S SKJrJrJ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  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SK J!r!  S SK"J#r#  S SK$J%r%  S SK&J'r'  S SK(J)r)J*r*J+r+  S SK,J-r-  S SK.J/r/  \ " S S\)5      5       r0g)    N)DictfinalList)AnnotateQparamsPass)AnnotateScalarParametersPass)Conv1dToConv2d)ConstantPropPass)FoldQDQPass)InsertQDQPass)ReplaceOpsWithScalar)get_node_visitors)ENN_COMPILE_OPTION_TITLE)EnnGraph)get_compile_spec)AddmmToLinearTransform)FuseBatchNormWithConvPass)RemoveGetItemPass)BackendDetailsCompileSpecPreprocessResult)PassManager)ExportedProgramc                   :    \ rS rSr\S\S\\   S\4S j5       r	Sr
g)
EnnBackend/   edge_programcompile_specsreturnc                 h   [         R                  " 5       n[        U[        SS9nUR	                  UR
                  5        [        [        U 5      [        5       [        U 5      [        U 5      [        U 5      [        5       [        5       [        5       [        U 5      [!        U 5      /
S9nU" U R"                  5      nUc   e[%        5       n['        U 5      n0 nUR"                  R(                  R*                   H  n	U	R,                  S:X  a  [.        R0                  " SU	 SU	R2                  R4                   35        U	R2                  R4                  U;   a*  XyR2                  R4                     R7                  XU5        M  [9        U	R2                  R4                   S35      eU	R,                  S;   a  M  [9        U	R,                   S35      e   UR;                  5         UR=                  5       n
UR?                  U
5      nUb  [A        U5      S	:  d   eURC                  5         [E        [G        U5      0 S
9$ )NT)required)passescall_functionz
Visiting: z, z! is not supported in ENN Delegate)get_attrplaceholderoutputr   )processed_bytesdebug_handle_map)$PyEnnWrapper
EnnWrapperr   r   Initvaluer   r   r
   r	   r   r   r   r   r   r   r   graph_moduler   r   graphnodesoplogginginfotarget__name__define_nodeRuntimeErrorfinish	serializeCompilelenDestroyr   bytes)r   r   enn_wrapperoption_specenn_preprocess_passespass_result	enn_graphnode_visitorsvals_to_idsnodeser_bufenn_context_binarys               i/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/executorch/backends/samsung/enn_preprocess.py
preprocessEnnBackend.preprocess1   s   
 #--/&3d
 	**+ +#L1 .|,),7&($&!#l+,\:!
 ,L,E,EF&&&J	),702,,2288Dww/)z$r$++2F2F1GHI;;''=8!++"6"67CC ';;//02UU    
 "dggY0S#STT% 9* 	%%'(009!-#6H2IA2MMM!"45
 	
     N)r3   
__module____qualname____firstlineno__staticmethodr   r   r   r   rG   __static_attributes__rJ   rI   rF   r   r   /   s3    <
%<
K(<
 
<
 <
rI   r   )1r0   typingr   r   r   6executorch.backends.samsung.python.PyEnnWrapperAdaptorbackendssamsungpythonPyEnnWrapperAdaptorr(   torch4executorch.backends.samsung._passes.annotate_qparamsr   >executorch.backends.samsung._passes.annotate_scalar_parametersr   4executorch.backends.samsung._passes.conv1d_to_conv2dr   <executorch.backends.samsung._passes.customized_constant_propr	   ,executorch.backends.samsung._passes.fold_qdqr
   .executorch.backends.samsung._passes.insert_qdqr   6executorch.backends.samsung._passes.replace_scalar_opsr   1executorch.backends.samsung.builders.node_visitorr   9executorch.backends.samsung.serialization.compile_optionsr   :executorch.backends.samsung.serialization.enn_graph_schemar   'executorch.backends.samsung.utils.utilsr   1executorch.backends.transforms.addmm_mm_to_linearr   8executorch.backends.transforms.fuse_batch_norm_with_convr   0executorch.backends.transforms.remove_getitem_opr   'executorch.exir.backend.backend_detailsr   r   r   executorch.exir.passesr   torch.export.exported_programr   r   rJ   rI   rF   <module>rh      s     $ $ M M  T P E H W O P D T O  / 9 >
 >
 >
rI   