
    Ng
                     t    d dl Zd dlZd dlmZ d dlmZ ddej        dedej        fdZ	 G d	 d
e          Z
dS )    N)Base)expectxaxisreturnc                     t          j        | |d          }t          j        | |z
            }t          j        ||d          }| |z
  t          j        |          z
  S )NT)r   keepdims)npmaxexpsumlog)r   r   x_maxtmpss        b/var/www/html/ai-engine/env/lib/python3.11/site-packages/onnx/backend/test/case/node/logsoftmax.py
logsoftmaxr      sX    F14$///E
&U

C
s---AI""    c                   >    e Zd Zedd            Zedd            ZdS )
LogSoftmaxr   Nc                      t           j                            ddgdg          } t          j        g dg                              t          j                  }t          |          }t          | |g|g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   s      r   exportzLogSoftmax.export   s    {$$5E % 
 

 Hjjj\""))"*55 qMMtQC!3NOOOOOOr   c                  n   t          j        g dg dg                              t           j                  } t	          |           }t
          j                            ddgdg          }t          || g|gd           t          j	        t           j
                            d	d
d                              t           j                            } t
          j                            ddgdgd          }t	          | d          }t          || g|gd           t
          j                            ddgdgd          }t	          | d          }t          || g|gd           t
          j                            ddgdgd          }t	          | d          }t          || g|gd           t
          j                            ddgdgd          }t	          | d          }t          || g|gd           t
          j                            ddgdg          }t          || g|g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'   s      r   export_logsoftmax_axisz!LogSoftmax.export_logsoftmax_axis!   su   Hlll$@$@$@ABBII"*UU qMM{$$5E % 
 

 	tQC!3QRRRRF29??1a++222:>>??{$$5E	 % 
 
 qq!!!tQC!3KLLLL{$$5E	 % 
 
 qq!!!tQC!3KLLLL{$$5E	 % 
 
 qq!!!tQC!3KLLLL{$$5E	 % 
 
 qr"""tQC!3RSSSS {$$5E % 
 

 	tQC!3QRRRRRRr   )r   N)__name__
__module____qualname__staticmethodr(   r7    r   r   r   r      s\        
P 
P 
P \
P 9S 9S 9S \9S 9S 9Sr   r   )r   )numpyr   r!   onnx.backend.test.case.baser   onnx.backend.test.case.noder   ndarrayintr   r   r<   r   r   <module>rB      s   
      , , , , , , . . . . . .# #"* #C # # # # #HS HS HS HS HS HS HS HS HS HSr   