§
    3�Åj«  ã                  ó&   — d dl mZ d dlZ	 ddd„ZdS )é    )ÚannotationsNÚvalueú
np.ndarrayÚshapeútuple[int, ...]ÚaxisÚintÚ
block_sizeú
int | NoneÚreturnc           
     óø  — t          | j        ¦  «        dk    r| S t          | j        ¦  «        dk    r| j        dk    r| d         S |s‹t          | j        ¦  «        dk    sJ ‚dgt          |¦  «        z  }	 | j        ||<   |                      t	          |¦  «        ¦  «        S # t
          $ r$}t          d|› d| j        › d|› d�¦  «        |‚d}~ww xY w|dk    rt          d¦  «        ‚t          j        | ||¬	¦  «        } ||         | j        |         k    r*|  	                    t          ||         ¦  «        |¬
¦  «        } | j        |k    rt          d¦  «        ‚t          j        || j        ¦  «        |k    sJ ‚| S )a¨  Reshape/Replicate scale/zero-point to be broadcastable to shape.

    Args:
        value: the array to be reshaped/replicated
        shape: the target shape
        axis: quantization axis, applicable for per-axis and blocked quantization
        block_size: size of quantization block, applicable only for blocked quantization

    Returns:
        value array after reshape/replicate according to quantization mode.
    r   é   zaxis is out of boundary, axis=z, value.shape=z, shape=ú.Nz&block_size must be a positive integer.)Úrepeatsr   )Úindicesr   z’Invalid shapes for Blocked Quantization. Input 2 shape should identical to Input 1 shape, except for one dimension, in which blocking is performed)Úlenr   ÚsizeÚreshapeÚtupleÚ
IndexErrorÚ
ValueErrorÚnpÚrepeatÚtakeÚrangeÚbroadcast_shapes)r   r   r   r
   ÚdimsÚes         úPC:\Projects\Historical\venv\Lib\site-packages\onnx/reference/ops/_quant_utils.pyÚreshape_inputr    	   sÀ  € õ" ˆ5Œ;ÑÔ˜1ÒÐØˆÝ
ˆ5Œ;ÑÔ˜!ÒÐ ¤
¨a¢ Ø�QŒxˆØð 
Ý�5”;ÑÔ 1Ò$Ð$Ð$Ð$Øˆs•S˜‘Z”ZÑˆð	ØœˆD�‰JØ—=’=¥ t¡¤Ñ-Ô-Ð-øÝð 	ð 	ð 	Ýð=°ð =ð =Ø$œ{ð=ð =Ø49ð=ð =ð =ñô ð ðøøøøð	øøøð �Q‚€ÝÐAÑBÔBÐBõ ŒI�e Z°dÐ;Ñ;Ô;€EàˆdŒ�u”{ 4Ô(Ò(Ð(à—
’
¥5¨¨t¬Ñ#5Ô#5¸D�
ÑAÔAˆØ„{�eÒÐÝð añ
ô 
ð 	
õ Ô˜u e¤kÑ2Ô2°eÒ;Ð;Ð;Ð;Ø€Ls   Á6+B" Â"
CÂ,CÃC)N)
r   r   r   r   r   r	   r
   r   r   r   )Ú
__future__r   Únumpyr   r    © ó    r   ú<module>r%      sM   ðð #Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð ð "ð	/ð /ð /ð /ð /ð /ð /r$   