o
    soi~
                     @  sT   d dl mZ d dlZd dlZd dlmZ d dlmZ ddddZ	G dd deZ
dS )    )annotationsN)Base)expectx
np.ndarrayaxisintreturnc                 C  s6   t j| |dd}t | | }t j||dd}|| S )NT)r   keepdims)npmaxexpsum)r   r   x_maxtmps r   W/home/ubuntu/.local/lib/python3.10/site-packages/onnx/backend/test/case/node/softmax.pysoftmax   s   r   c                   @  s(   e Zd ZedddZedddZdS )	Softmaxr
   Nonec                  C  sR   t jjddgdgd} tg dgtj}t|dd}t| |g|gdd	 d S )
Nr   r   yinputsoutputs)r   r      r   r   test_softmax_exampler   r   name)	onnxhelper	make_noder   arrayastypefloat32r   r   )noder   r   r   r   r   export   s   zSoftmax.exportc                  C  s|  t g dg dgt j} t| }tjjddgdgd}t|| g|gdd t 	t j
d	d
dt j} tjjddgdgdd}t| dd}t|| g|gdd tjjddgdgdd}t| dd}t|| g|gdd tjjddgdgdd}t| dd}t|| g|gdd tjjddgdgdd}t| dd}t|| g|gdd tjjddgdgd}t|| g|gdd d S )N)r   r         )i'  i'  i'  i'  r   r   r   r   test_softmax_large_numberr   r*         r   )r   r   r   r   test_softmax_axis_0r   test_softmax_axis_1r)   test_softmax_axis_2r   test_softmax_negative_axistest_softmax_default_axis)r   r$   r%   r&   r   r!   r"   r#   r   absrandomrandn)r   r   r'   r   r   r   export_softmax_axis!   s^   zSoftmax.export_softmax_axisN)r
   r   )__name__
__module____qualname__staticmethodr(   r6   r   r   r   r   r      s
    r   )r   )r   r   r   r	   r
   r   )
__future__r   numpyr   r!   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r   r   r   r   r   <module>   s   