o
    wi
                     @  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  s@   t j| |dd}t | | }t j||dd}| | t | S )NT)r   keepdims)npmaxexpsumlog)r   r   x_maxtmps r   c/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/onnx/backend/test/case/node/logsoftmax.py
logsoftmax   s   r   c                   @  s(   e Zd ZedddZedddZdS )	
LogSoftmaxr
   Nonec                  C  sN   t jjddgdgd} tg dgtj}t|}t| |g|gdd d S )Nr   r   yinputsoutputs)r   r      test_logsoftmax_example_1r   r   name)	onnxhelper	make_noder   arrayastypefloat32r   r   )noder   r   r   r   r   export   s   zLogSoftmax.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_logsoftmax_large_numberr   r*         r   )r   r   r   )r   test_logsoftmax_axis_0r   test_logsoftmax_axis_1r)   test_logsoftmax_axis_2r   test_logsoftmax_negative_axistest_logsoftmax_default_axis)r   r$   r%   r&   r   r!   r"   r#   r   absrandomrandn)r   r   r'   r   r   r   export_logsoftmax_axis"   s^   z!LogSoftmax.export_logsoftmax_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   