U
    qh^                     @  sD   d dl mZ d dlZd dlmZ G dd deZG dd deZdS )    )annotationsN)OpRunReduceNumpyc                   @  s   e Zd ZdddZdS )ReduceSum_1Nc                 C  sL   |d k	rt |nd }tj||||jd}|dkrFt|tjsFt|}|fS )NZaxiskeepdimsdtyper   )tuplenpsumr   
isinstancendarrayarray)selfxaxesr   res r   D/tmp/pip-unpacked-wheel-xnis5xre/onnx/reference/ops/op_reduce_sum.py_run   s
    
zReduceSum_1._run)NN__name__
__module____qualname__r   r   r   r   r   r      s   r   c                   @  s   e Zd ZdddZdS )ReduceSum_13Nc                 C  s   |d ks|j dkr|r|fS | |}z:tj||||jd}|dkrZt|tjsZt|}|fW S  tk
r } z$td|j d|d| d|W 5 d }~X Y nX d S )N)r   r   r   zUnable to reduce shape z with axes=z and keepdims=.)	shapeZhandle_axesr	   r
   r   r   r   r   	TypeError)r   r   r   r   Znoop_with_empty_axesr   er   r   r   r      s    

zReduceSum_13._run)NNNr   r   r   r   r   r      s   r   )
__future__r   Znumpyr	   Zonnx.reference.ops._opr   r   r   r   r   r   r   <module>   s   
