U
    “±Ëh|  ã                   @   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   úY/tmp/pip-unpacked-wheel-socb9apf/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   ÚtableZTabler   )Úselfr   Úposr   r   r   r	      s    zKeyValue.Initc                 C   s6   t jj | j d¡¡}|dkr2| j || jj ¡S d S )Né   r   ©r   Únumber_typesÚUOffsetTFlagsÚpy_typer   ZOffsetÚStringZPos©r   Úor   r   r   ÚKey   s    zKeyValue.Keyc                 C   s6   t jj | j d¡¡}|dkr2| j || jj ¡S d S )Né   r   r   r   r   r   r   ÚValue&   s    zKeyValue.ValueN)r   )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   s   t | ƒS )z2This method is deprecated. Please switch to Start.)r)   r'   r   r   r   ÚKeyValueStart1   s    r*   c                 C   s   |   dtjj |¡d¡ d S )Nr   ©ZPrependUOffsetTRelativeSlotr   r   r   r   ©r(   Úkeyr   r   r   ÚAddKey6   s    r.   c                 C   s
   t | |ƒS )z3This method is deprecated. Please switch to AddKey.)r.   r,   r   r   r   ÚKeyValueAddKey:   s    r/   c                 C   s   |   dtjj |¡d¡ d S )Né   r   r+   ©r(   Úvaluer   r   r   ÚAddValue?   s    r3   c                 C   s
   t | |ƒS )z5This method is deprecated. Please switch to AddValue.)r3   r1   r   r   r   ÚKeyValueAddValueC   s    r4   c                 C   s   |   ¡ S r   )Z	EndObjectr'   r   r   r   ÚEndH   s    r5   c                 C   s   t | ƒS )z0This method is deprecated. Please switch to End.)r5   r'   r   r   r   ÚKeyValueEndL   s    r6   )r   Zflatbuffers.compatr   Únpr   r)   r*   r.   r/   r3   r4   r5   r6   r   r   r   r   Ú<module>   s   "