
    bIg~
                    X    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Z	 G d de      Z
y)
    )annotationsN)Base)expectc                    t        j                  | |d      }t        j                  | |z
        }t        j                  ||d      }||z  S )NT)axiskeepdims)npmaxexpsum)xr   x_maxtmpss        `/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/softmax.pysoftmaxr      sA    FF14$/E
&&U
C
s-A7N    c                  0    e Zd Zedd       Zedd       Zy)Softmaxc                     t         j                  j                  ddgdg      } t        j                  g dg      j                  t        j                        }t        |d      }t        | |g|gd	       y )
Nr   r   yinputsoutputs)r      r   r   test_softmax_exampler   r   name)	onnxhelper	make_noder	   arrayastypefloat32r   r   )noder   r   s      r   exportzSoftmax.export   sh    {{$$5E % 

 HHj\"))"**5AAtQC!3IJr   c                    t        j                  g dg dg      j                  t         j                        } t	        |       }t
        j                  j                  ddgdg      }t        || g|gd       t        j                  t         j                  j                  d	d
d      j                  t         j                              } t
        j                  j                  ddgdgd      }t	        | d      }t        || g|gd       t
        j                  j                  ddgdgd      }t	        | d      }t        || g|gd       t
        j                  j                  ddgdgd      }t	        | d      }t        || g|gd       t
        j                  j                  ddgdgd      }t	        | d      }t        || g|gd       t
        j                  j                  ddgdg      }t        || g|gd       y )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!   s   HHl$@ABII"**U AJ{{$$5E % 

 	tQC!3NOFF299??1a+222::>?{{$$5E	 % 
 AAtQC!3HI{{$$5E	 % 
 AAtQC!3HI{{$$5E	 % 
 AAtQC!3HI{{$$5E	 % 
 ABtQC!3OP {{$$5E % 

 	tQC!3NOr   N)returnNone)__name__
__module____qualname__staticmethodr(   r7    r   r   r   r      s,    	K 	K 9P 9Pr   r   )r   )r   
np.ndarrayr   intr8   r?   )
__future__r   numpyr	   r!   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r   r>   r   r   <module>rE      s+    #   , .GPd GPr   