§
    
íNgº  ã                  óD   — d dl mZ d dlZd dlmc mZ 	 ddd	„Z	 ddd„ZdS )é    )ÚannotationsNFÚmodelúonnx.ModelProtoÚconvert_versionÚboolÚreturnc                ó¤   — t          j        |                      ¦   «         |¦  «        }t          j        ¦   «         }|                     |¦  «         |S )ab  Inline model-local functions in given model.

    Arguments:
        model: an ONNX ModelProto
        convert_version: if true, try to apply automatic version-conversion to functions requiring a
            different (ONNX) opset version from the model.

    Returns:
        ModelProto with all calls to model-local functions inlined (recursively)
    )ÚCÚinline_local_functionsÚSerializeToStringÚonnxÚ
ModelProtoÚParseFromString)r   r   ÚresultÚinlined_models       úH/var/www/html/ai-engine/env/lib/python3.11/site-packages/onnx/inliner.pyr   r      sI   € õ Ô% e×&=Ò&=Ñ&?Ô&?ÀÑQÔQ€FÝ”OÑ%Ô%€MØ×!Ò! &Ñ)Ô)Ð)ØÐó    Úfunction_idsúlist[tuple[str, str]]Úexcludec                ó¦   — t          j        |                      ¦   «         ||¦  «        }t          j        ¦   «         }|                     |¦  «         |S )aü  Inline selected model-local functions in given model.

    Arguments:
        model: an ONNX ModelProto
        function_ids: list of functions to include/exclude when inlining. Each
            element is a tuple of (function domain, function name).
        exclude: if true, inlines all functions except those specified in function_ids.
           if false, inlines all functions specified in function_ids.

    Returns:
        ModelProto with all calls to model-local functions inlined (recursively)
    )r
   Úinline_selected_functionsr   r   r   r   )r   r   r   r   r   s        r   r   r      sR   € õ Ô(Ø×ÒÑ!Ô! <°ñô €Fõ ”OÑ%Ô%€MØ×!Ò! &Ñ)Ô)Ð)ØÐr   )F)r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )	Ú
__future__r   r   Úonnx.onnx_cpp2py_export.inlinerÚonnx_cpp2py_exportÚinlinerr
   r   r   © r   r   ú<module>r      s…   ðð
 #Ð "Ð "Ð "Ð "Ð "à €€€Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +ð 5:ðð ð ð ð ð( RWðð ð ð ð ð ð r   