o
    wi^                     @  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                   @     e Zd ZdddZdS )ReduceSum_1Nc                 C  sL   |d urt |nd }tj||||jd}|dkr#t|tjs#t|}|fS )Naxiskeepdimsdtyper   )tuplenpsumr	   
isinstancendarrayarray)selfxaxesr   res r   ]/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/onnx/reference/ops/op_reduce_sum.py_run   s
   
zReduceSum_1._run)NN__name__
__module____qualname__r   r   r   r   r   r          r   c                   @  r   )ReduceSum_13Nc                 C  s   |d u s	|j dkr|r|fS | |}ztj||||jd}|dkr-t|tjs-t|}|fW S  tyL } ztd|j d|d| d|d }~ww )N)r   r   r   zUnable to reduce shape z with axes=z and keepdims=.)	shapehandle_axesr   r   r	   r   r   r   	TypeError)r   r   r   r   noop_with_empty_axesr   er   r   r   r      s    

zReduceSum_13._run)NNNr   r   r   r   r   r      r   r   )
__future__r   numpyr   onnx.reference.ops._opr   r   r   r   r   r   r   <module>   s
   
