+
    G-j(  ã                   óN  € ^ RI t ^ RIt^ RIt^RIHt ]P
                  ! ]4      tR t]R8X  Edv   ]! 4       t	]	P                  '       dG   ]	P                  '       d5   ]	P                  '       d#   ]P                  R4       ]P                  ! 4        ]	P                  '       g5   ]	P                  '       d#   ]P                  R4       ]P                  ! 4        ]P!                  R]	P"                  4       ]P!                  R]	P$                  4       ]! ]	P"                  ]	P$                  ]	P                  ]	P                  ]	P                  ]	P&                  ]	P(                  ]	P*                  ]	P,                  ]	P                  ]	P.                  ]	P0                  ]	P2                  4       R# R# )	é    N)Úquant_pre_processc                  óœ  € \         P                  ! R R7      p V P                  RRRR7       V P                  RRRR7       V P                  R\        R	R
R7       V P                  R\        R	RR7       V P                  R\        R	RR7       V P                  RRRR	R7       V P                  RR\        R&R7       V P                  RRRR	R7       V P                  RR\        ^ R7       V P                  RRRR	R7       V P                  RRRR	R7       V P                  RR R!R"7       V P                  R#R$\        R%R7       V P                  4       # )'aÜ  Model optimizer and shape inferencer, in preparation for quantization,
Consists of three optional steps:
1. Symbolic shape inference (best for transformer models).
2. Model optimization.
3. ONNX shape inference.

Model quantization with QDQ format, i.e. inserting QuantizeLinear/DeQuantizeLinear on
the tensor, requires tensor shape information to perform its best. Currently, shape inferencing
works best with optimized model. As a result, it is highly recommended to run quantization
on optimized model with shape information. This is the tool for optimization and shape
inferencing.

Essentially this tool performs the following three (skippable) steps:

1. Symbolic shape inference.
2. Model optimization
3. ONNX shape inference)Údescriptionz--inputTzPath to the input model file)ÚrequiredÚhelpz--outputzPath to the output model filez--skip_optimizationFz°Skip model optimization step if true. It's a known issue that ORT optimization has difficulty with model size greater than 2GB, rerun with this option to get around this issue.)ÚtypeÚdefaultr   z--skip_onnx_shapezåSkip ONNX shape inference. Symbolic shape inference is most effective with transformer based models. Skipping all shape inferences may reduce the effectiveness of quantization, as a tensor with unknown shape can not be quantized.z--skip_symbolic_shapezéSkip symbolic shape inference. Symbolic shape inference is most effective with transformer based models. Skipping all shape inferences may reduce the effectiveness of quantization, as a tensor with unknown shape can not be quantized.z--auto_mergez:Automatically merge symbolic dims when confliction happensÚ
store_true)r   Úactionr	   z	--int_maxzGmaximum value for integer to be treated as boundless for ops like slice)r   r   r	   z--guess_output_rankz;guess output rank to be the same as input 0 for unknown opsz	--verbosezHPrints detailed logs of inference, 0: turn off, 1: warnings, 3: detailedz--save_as_external_dataz%Saving an ONNX model to external dataz--all_tensors_to_one_filez(Saving all the external data to one filez--external_data_locationz+The file location to save the external fileN)r   r	   z--external_data_size_thresholdz$The size threshold for external datai   iÿÿÿ)ÚargparseÚArgumentParserÚadd_argumentÚboolÚintÚ
parse_args)Úparsers    Út/Volumes/fast/ai/experiments/nudenet-smoke/.venv/lib/python3.14/site-packages/onnxruntime/quantization/preprocess.pyÚparse_argumentsr      sÂ  € Ü×$Ò$ðô€Fð( ×Ñ˜	¨DÐ7UÐÔVØ
×Ñ˜
¨TÐ8WÐÔXØ
×ÑØÜØð1ð	 ô ð ×ÑØÜØð'ð	 ô ð ×ÑØÜØð4ð	 ô ð ×ÑØØIØØð	 ô ð ×ÑØØVÜØð	 ô ð ×ÑØØJØØð	 ô ð ×ÑØØWÜØð	 ô ð ×ÑØ!Ø4ØØð	 ô ð ×ÑØ#Ø7ØØð	 ô ð ×ÑØ"Ø:Øð ô ð
 ×ÑØ(Ø3ÜØð	 ô ð ×ÑÓÐó    Ú__main__z9Skipping all three steps, nothing to be done. Quitting...z:ORT model optimization does not support external data yet!zinput model: %szoutput model: %s)r   ÚloggingÚsysÚshape_inferencer   Ú	getLoggerÚ__name__Úloggerr   ÚargsÚskip_optimizationÚskip_onnx_shapeÚskip_symbolic_shapeÚerrorÚexitÚsave_as_external_dataÚinfoÚinputÚoutputÚ
auto_mergeÚint_maxÚguess_output_rankÚverboseÚall_tensors_to_one_fileÚexternal_data_locationÚexternal_data_size_threshold© r   r   Ú<module>r/      s?  ðó Û Û 
å .à	×	Ò	˜8Ó	$€ò`ðF ˆzÕÙÓ€DØ××Ð $×"6×"6Ð"6¸4×;S×;SÐ;SØ�‰ÐPÔQØ�ŠŒ
à×"×"Ð"¨×(B×(BÐ(BØ�‰ÐQÔRØ�ŠŒ
à
‡K�KÐ! 4§:¡:Ô.Ø
‡K�KÐ" D§K¡KÔ0ÙØ�
‰
Ø�‰Ø×ÑØ×ÑØ× Ñ Ø�‰Ø�‰Ø×ÑØ�‰Ø×"Ñ"Ø×$Ñ$Ø×#Ñ#Ø×)Ñ)öñ r   