o
    wiD
                     @  s@   d dl mZ d dlZd dlmZ d dlmZ G dd deZdS )    )annotationsN)OpRun)_conv_implementationc                   @  s$   e Zd Z							dddZdS )QLinearConvNc              
   C  s  |
p| j }
|p	| j}|p| j}|p| j}|p| j}|p| j}|tj}|d ur,||8 }|tj}|d urbt	|j
dkr^|j
d |j
d kr^|j
d fdt	|j
d   }|||8 }n||8 }t|||	|
|||||	tj}t|dkrt|dkrtdt
| dt|t
|d krtdt| dt
|d  t|d}||| |  }|d ur||7 }|jtjkrt|d	d
}nt|dd}t||jfS |jtjkrt|d	d
}nt|dd}t||jfS )N   r   )r   z4w_scale must be a scalar or a 1-D tensor. Got shape .z-w_scale elements must match output channels: z != )r         i      )auto_pad	dilationsgroupkernel_shapepadsstridesastypenpint32lenshapereshaper   sizendim
ValueErrorexpand_dimsdtypeint8clipround)selfxx_scalex_zero_pointww_scalew_zero_pointy_scaley_zero_pointBr   r   r   r   r   r   XWmissingresR r/   _/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/onnx/reference/ops/op_qlinear_conv.py_run   sR   





"zQLinearConv._run)NNNNNNN)__name__
__module____qualname__r1   r/   r/   r/   r0   r      s    r   )	
__future__r   numpyr   onnx.reference.op_runr   onnx.reference.ops.op_convr   r   r/   r/   r/   r0   <module>   s
   