Ë
    ÝÍ:j	  ã                   óJ   — d Z ddlmZ ddlmZ  eh d£«      Z G d„ de«      Zy)z 
Implements ONNX's backend API.
é    )Ú
BackendRep)Ú
RunOptions>   ÚlogidÚlog_severity_levelÚlog_verbosity_levelÚonly_execute_path_to_fetchesc                   ó   — e Zd ZdZd„ Zd„ Zy)ÚOnnxRuntimeBackendRepz™
    Wraps an :class:`onnxruntime.InferenceSession` to implement ONNX's
    :class:`onnx.backend.base.BackendRep` interface for running predictions.
    c                 ó   — || _         y)zG
        :param session: :class:`onnxruntime.InferenceSession`
        N)Ú_session)ÚselfÚsessions     út/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/onnxruntime/backend/backend_rep.pyÚ__init__zOnnxRuntimeBackendRep.__init__    s   € ð  ˆ�ó    c                 óX  — t        «       }|j                  «       D ]T  \  }}|t        v rt        |||«       Œt	        ||«      sŒ)t        d|› ddj                  t        t        «      «      › �«      ‚ t        |t        «      r²i }t        | j                  j                  «       «      D ]  \  }}||   ||j                  <   Œ | j                  j                  d||«      }	t        |	t        «      r|	S | j                  j                  «       D �
cg c]  }
|
j                  ‘Œ }}
|D �cg c]  }|	|   ‘Œ	 c}S | j                  j                  «       }t!        |«      dk7  rt        dt!        |«      › d�«      ‚|d   j                  |i}| j                  j                  d||«      S c c}
w c c}w )	a«  
        Computes the prediction.
        See :meth:`onnxruntime.InferenceSession.run`.

        :param inputs: a list of input arrays (one per model input) or a single
            array when the model has exactly one input
        :param kwargs: only a safe subset of :class:`onnxruntime.RunOptions` attributes are
            accepted; see ``_ALLOWED_RUN_OPTIONS`` for the list
        :return: list of output arrays
        zRunOptions attribute 'z<' is not permitted via the backend API. Allowed attributes: z, Né   zModel expect z inputsr   )r   ÚitemsÚ_ALLOWED_RUN_OPTIONSÚsetattrÚhasattrÚRuntimeErrorÚjoinÚsortedÚ
isinstanceÚlistÚ	enumerater   Ú
get_inputsÚnameÚrunÚget_outputsÚlen)r   ÚinputsÚkwargsÚoptionsÚkÚvÚinpsÚiÚinpÚoutsÚoÚoutput_namesr   s                r   r    zOnnxRuntimeBackendRep.run&   s‡  € ô “,ˆØ—L‘L“Nò 	‰DˆAˆqØÔ(Ñ(Ü˜  AÕ&Ü˜ !Õ$Ü"Ø,¨Q¨Cð 0+Ø+/¯9©9´VÔ<PÓ5QÓ+RÐ*SðUóð ð		ô �fœdÔ#ØˆDÜ# D§M¡M×$<Ñ$<Ó$>Ó?ò +‘��3Ø!'¨¡��S—X‘X’ð+à—=‘=×$Ñ$ T¨4°Ó9ˆDÜ˜$¤Ô%Ø�à04·±×0IÑ0IÓ0KÖL¨1 §£ÐL�ÐLØ/;Ö< t˜˜T›
Ò<Ð<à—-‘-×*Ñ*Ó,ˆCÜ�3‹x˜1Š}Ü" ]´3°s³8°*¸GÐ#DÓEÐEØ˜‘F—K‘K Ð(ˆDØ—=‘=×$Ñ$ T¨4°Ó9Ð9ùò  MùÚ<s   ÄF"Ä%F'N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r    © r   r   r
   r
      s   „ ñò
 ó&:r   r
   N)r1   Úonnx.backend.baser   Úonnxruntimer   Ú	frozensetr   r
   r2   r   r   ú<module>r6      s0   ðñ
õ )å "ñ
 !òóÐ ô2:˜Jõ 2:r   