o
    ¢Äi|  ã                   @   sl   d dl Z d dlmZ eƒ ZG dd„ dƒZdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ ZdS )é    N)Úimport_numpyc                   @   sF   e Zd ZdgZeddd„ƒZeddd„ƒZdd„ Zd	d
„ Zdd„ Z	dS )ÚKeyValueÚ_tabr   c                 C   s.   t j t jj||¡}tƒ }| ||| ¡ |S ©N)ÚflatbuffersÚencodeZGetÚpackerZuoffsetr   ÚInit)ÚclsÚbufÚoffsetÚnÚx© r   úo/home/kim/smarthome/.venv/lib/python3.10/site-packages/onnxruntime/quantization/CalTableFlatBuffers/KeyValue.pyÚ	GetRootAs   s   zKeyValue.GetRootAsc                 C   s   |   ||¡S )z6This method is deprecated. Please switch to GetRootAs.)r   )r
   r   r   r   r   r   ÚGetRootAsKeyValue   s   zKeyValue.GetRootAsKeyValuec                 C   s   t j ||¡| _d S r   )r   ÚtableÚTabler   )Úselfr   Úposr   r   r   r	      s   zKeyValue.Initc                 C   ó6   t jj | j d¡¡}|dkr| j || jj ¡S d S )Né   r   ©r   Únumber_typesÚUOffsetTFlagsÚpy_typer   ZOffsetÚStringÚPos©r   Úor   r   r   ÚKey   ó   zKeyValue.Keyc                 C   r   )Né   r   r   r   r   r   r   ÚValue&   r"   zKeyValue.ValueN)r   )
Ú__name__Ú
__module__Ú__qualname__Ú	__slots__Úclassmethodr   r   r	   r!   r$   r   r   r   r   r      s    r   c                 C   s   |   d¡ d S )Né   )ZStartObject©Úbuilderr   r   r   ÚStart-   s   r-   c                 C   ó   t | ƒS )z2This method is deprecated. Please switch to Start.)r-   r+   r   r   r   ÚKeyValueStart1   ó   r/   c                 C   s   |   dtjj |¡d¡ d S )Nr   ©ZPrependUOffsetTRelativeSlotr   r   r   r   ©r,   Úkeyr   r   r   ÚAddKey6   ó   r4   c                 C   ó
   t | |ƒS )z3This method is deprecated. Please switch to AddKey.)r4   r2   r   r   r   ÚKeyValueAddKey:   ó   
r7   c                 C   s   |   dtjj |¡d¡ d S )Né   r   r1   ©r,   Úvaluer   r   r   ÚAddValue?   r5   r<   c                 C   r6   )z5This method is deprecated. Please switch to AddValue.)r<   r:   r   r   r   ÚKeyValueAddValueC   r8   r=   c                 C   s   |   ¡ S r   )Z	EndObjectr+   r   r   r   ÚEndH   s   r>   c                 C   r.   )z0This method is deprecated. Please switch to End.)r>   r+   r   r   r   ÚKeyValueEndL   r0   r?   )r   Zflatbuffers.compatr   Únpr   r-   r/   r4   r7   r<   r=   r>   r?   r   r   r   r   Ú<module>   s   "