
    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  S )NT)r   keepdims)npmaxexpsum)r   r   x_maxtmpss        _/var/www/html/ai-engine/env/lib/python3.11/site-packages/onnx/backend/test/case/node/softmax.pysoftmaxr      sJ    F14$///E
&U

C
s---A7N    c                   >    e Zd Zedd            Zedd            ZdS )Softmaxr   Nc                     t           j                            ddgdg          } t          j        g dg                              t          j                  }t          |d          }t          | |g|g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   s      r   exportzSoftmax.export   s    {$$5E % 
 

 Hjjj\""))"*55AAtQC!3IJJJJJJr   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_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'   s      r   export_softmax_axiszSoftmax.export_softmax_axis    su   Hlll$@$@$@ABBII"*UU AJJ{$$5E % 
 

 	tQC!3NOOOOF29??1a++222:>>??{$$5E	 % 
 
 AAtQC!3HIIII{$$5E	 % 
 
 AAtQC!3HIIII{$$5E	 % 
 
 AAtQC!3HIIII{$$5E	 % 
 
 ABtQC!3OPPPP {$$5E % 
 

 	tQC!3NOOOOOOr   )r   N)__name__
__module____qualname__staticmethodr(   r7    r   r   r   r      s\        	K 	K 	K \	K 9P 9P 9P \9P 9P 9Pr   r   )r   )numpyr   r!   onnx.backend.test.case.baser   onnx.backend.test.case.noder   ndarrayintr   r   r<   r   r   <module>rB      s   
      , , , , , , . . . . . . rz  bj    GP GP GP GP GPd GP GP GP GP GPr   