
    h                     L    S SK rS SKrS SKJr  S SKJr  SS jr " S S\5      rg)    N)Base)expectc                 r   U R                   n[        U5      S:X  a  [        S5      eUR                   nUS   nUS   n	[        R                  " U SSS9n
[        R
                  " X
-
  5      nU[        R                  " USSS9-  n[        R                  " U5      nS nUSL a  [        R                  " U5      nS nUbp  [        R                  " U[        R                  " U[        R                  S9SS9nUb5  [        R                  " X:H  SU5      R                  [        R                  S9nO8Ub5  [        R                  " X:H  SS5      R                  [        R                  S9n[        U5      S	:w  a&  UR                  XS
45      nUR                  US
45      nUR                   S   n[        R                   " UU4[        R                  S9n[#        U5       H;  n[#        U5       H)  nUU   U   U:w  d  M  UU   UU   U      U   * UU   U'   M+     M=     Un[        U5      S	:w  a  UR                  U5      nUb7  UU-  nUS:X  a,  UR                  5       UR                  5       -  nUSL a  UU4$ U$ US:X  a  [        R$                  " U5      nOUS:X  a  [        R                  " U5      nU(       a  UU4$ U$ )N   zUnsupported shaper   T)axiskeepdimsdtypeclip)mode      meansum)shapelenRuntimeErrornpmaxexpr   logcopytakearrayint32whereastypefloat32reshapezerosranger   )xtargetweight	reductionignore_indexget_log_probinput_shapetarget_shapeNCmax_xexp_xpinplog_probgather_weightDneg_gather_element_inputidlosss                        i/var/www/fran/franai/venv/lib/python3.13/site-packages/onnx/backend/test/case/node/softmaxcrossentropy.pysoftmaxcrossentropyr9      s   ''K
;1.//<<LAAAA FF11t,EFF19Eu1t44A
&&)CHt773< M
 rxx(HvV #HHV%;QNUUjj V M 
	!!7A>EEBJJEW ;1kk1*%B( 			!A!xxAbjjA1XqAay||+25a&12Fq2I1I(+A.  
 $D ;1||L)  t#88: 1 1 33Dt#X~%Fwwt}	e	vvd|X~K    c                      \ rS rSr\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r	\S&S j5       r
\S&S	 j5       r\S&S
 j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r\S&S j5       r \S&S j5       r!\S&S  j5       r"\S&S! j5       r#\S&S" j5       r$\S&S# j5       r%\S&S$ j5       r&S%r'g)'SoftmaxCrossEntropyLossZ   Nc                     Sn [         R                  R                  SSS/S/U S9n[        R                  R                  S5        [        R                  R                  SS	5      R                  [        R                  5      n[        R                  R                  SS	S
S9R                  [        R                  5      n[        X#SS9n[        XU/U/SS9  g )Nnoner<   r#   yzinputsoutputsr&   r   r      r   highsizer&   test_sce_nonerC   rD   nameonnxhelper	make_noder   randomseedrandr   r   randintint64r9   r   r&   noder#   labelssces        r8   export_softmaxcrossentropy_none7SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none[   s     	 {{$$%:E	 % 
 			qIINN1a ''

3""114"8??I "!v> 	tK#_Mr:   c                     Sn [         R                  R                  SSS/SS/U S9n[        R                  R                  S5        [        R                  R                  S	S
5      R                  [        R                  5      n[        R                  R                  SS
SS9R                  [        R                  5      n[        X#SSS9u  pE[        UX#/XE/SS9  g )Nr?   r<   r#   r@   rA   r1   rB   r   r   rE   rF   rG   Tr&   r(   test_sce_none_log_probrL   rN   r&   rX   r#   rY   r7   r1   s         r8   (export_softmaxcrossentropy_none_log_prob@SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none_log_probs   s     	 {{$$%:*%	 % 
 			qIINN1a ''

3""114"8??I -d

 	;$)		
r:   c                     Sn [         R                  R                  S/ SQS/U S9n[        R                  R                  S5        [        R                  R                  SS5      R                  [        R                  5      n[        R                  R                  SSS	S
9R                  [        R                  5      n[        R                  " / SQ[        R                  S9n[        X#USS9n[        UX#U/U/SS9  g )Nr?   r<   r#   r@   wrA   rB   r   r   rE   rF   rG   ?gffffff?g?rg   rg   r	   r%   r&   test_sce_none_weightsrL   rO   rP   rQ   r   rR   rS   rT   r   r   rU   rV   r   r9   r   r&   rX   r#   rY   weightsrZ   s         r8   'export_softmaxcrossentropy_none_weights?SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none_weights   s     	 {{$$%"E	 % 
 			qIINN1a ''

3""114"8??I((4BJJG "!GvN 	w'E(		
r:   c                     Sn [         R                  R                  S/ SQSS/U S9n[        R                  R                  S5        [        R                  R                  SS	5      R                  [        R                  5      n[        R                  R                  SS	S
S9R                  [        R                  5      n[        R                  " / SQ[        R                  S9n[        X#USSS9u  pV[        UX#U/XV/SS9  g )Nr?   r<   rd   rA   r1   rB   r   r   rE   rF   rG   rf   r	   Tr%   r&   r(   test_sce_none_weights_log_probrL   rj   r&   rX   r#   rY   rl   r7   r1   s          r8   0export_softmaxcrossentropy_none_weights_log_probHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none_weights_log_prob   s     	 {{$$%"*%	 % 
 			qIINN1a ''

3""114"8??I((4BJJG -gd

 	w'$1		
r:   c                     Sn [         R                  R                  SSS/S/U S9n[        R                  R                  S5        [        R                  R                  SS	5      R                  [        R                  5      n[        R                  R                  SS	S
S9R                  [        R                  5      n[        X#SS9n[        XU/U/SS9  g )Nr   r<   r#   r@   rA   rB   r   r   rE   rF   rG   rJ   test_sce_sumrL   rN   rW   s        r8   export_softmaxcrossentropy_sum6SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_sum   s     	 {{$$%:E	 % 
 			qIINN1a ''

3""114"8??I "!u= 	tK#^Lr:   c                     Sn [         R                  R                  SSS/SS/U S9n[        R                  R                  S5        [        R                  R                  S	S
5      R                  [        R                  5      n[        R                  R                  SS
SS9R                  [        R                  5      n[        X#SSS9u  pE[        UX#/XE/SS9  g )Nr   r<   r#   r@   rA   r1   rB   r   r   rE   rF   rG   Tr^   test_sce_sum_log_probrL   rN   r`   s         r8   'export_softmaxcrossentropy_sum_log_prob?SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_sum_log_prob   s     	 {{$$%:*%	 % 
 			qIINN1a ''

3""114"8??I -T

 	;$(		
r:   c                     Sn [         R                  R                  SSS/S/U S9n[        R                  R                  S5        [        R                  R                  SS	5      R                  [        R                  5      n[        R                  R                  SS	S
S9R                  [        R                  5      n[        X#5      n[        XU/U/SS9  g )Nr   r<   r#   r@   rA   rB   r   r   rE   rF   rG   test_sce_meanrL   rN   rW   s        r8   export_softmaxcrossentropy_mean7SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean  s     	 {{$$%:E	 % 
 			qIINN1a ''

3""114"8??I "!, 	tK#_Mr:   c                     Sn [         R                  R                  SSS/SS/U S9n[        R                  R                  S5        [        R                  R                  S	S
5      R                  [        R                  5      n[        R                  R                  SS
SS9R                  [        R                  5      n[        X#SS9u  pE[        UX#/XE/SS9  g )Nr   r<   r#   r@   rA   r1   rB   r   r   rE   rF   rG   Tr(   test_sce_mean_log_probrL   rN   r`   s         r8   (export_softmaxcrossentropy_mean_log_prob@SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_log_prob  s     	 {{$$%:*%	 % 
 			qIINN1a ''

3""114"8??I -QTJ 	;$)		
r:   c                     Sn [         R                  R                  SSS/S/U S9n[        R                  R                  S5        [        R                  R                  SS	S
5      R                  [        R                  5      n[        R                  R                  SS	SS9R                  [        R                  5      n[        X#5      n[        XU/U/SS9  g )Nr   r<   r#   r@   rA   rB   r   r   rE   r   r   r   rG   test_sce_mean_3drL   rN   )r&   rX   r#   r@   rZ   s        r8   "export_softmaxcrossentropy_mean_3d:SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_3d<  s     	 {{$$%:E	 % 
 			qIINN1a#**2::6IIaaf5<<RXXF "!' 	tFSE8JKr:   c                     Sn [         R                  R                  SSS/SS/U S9n[        R                  R                  S5        [        R                  R                  S	S
S5      R                  [        R                  5      n[        R                  R                  SS
SS9R                  [        R                  5      n[        X#SS9u  pE[        UX#/XE/SS9  g )Nr   r<   r#   r@   rA   r1   rB   r   r   rE   r   r   rG   Tr   test_sce_mean_3d_log_probrL   rN   )r&   rX   r#   r@   r7   r1   s         r8   +export_softmaxcrossentropy_mean_3d_log_probCSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_3d_log_probT  s     	 {{$$%:*%	 % 
 			qIINN1a#**2::6IIaaf5<<RXXF -QE 	6$,		
r:   c                     Sn [         R                  R                  S/ SQS/U S9n[        R                  R                  S5        [        R                  R                  SS5      R                  [        R                  5      n[        R                  R                  SSS	S
9R                  [        R                  5      n[        R                  " / SQ[        R                  S9n[        X#US9n[        UX#U/U/SS9  g )Nr   r<   rd   rA   rB   r   r   rE   rF   rG   rf   r	   )r%   test_sce_mean_weightrL   rj   rk   s         r8   'export_softmaxcrossentropy_mean_weights?SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weightsq  s     	 {{$$%"E	 % 
 			qIINN1a ''

3""114"8??I((4BJJG "!G< 	w'E'		
r:   c                     Sn [         R                  R                  S/ SQSS/U S9n[        R                  R                  S5        [        R                  R                  SS	5      R                  [        R                  5      n[        R                  R                  SS	S
S9R                  [        R                  5      n[        R                  " / SQ[        R                  S9n[        X#USS9u  pV[        UX#U/XV/SS9  g )Nr   r<   rd   rA   r1   rB   r   r   rE   rF   rG   rf   r	   T)r%   r(   test_sce_mean_weight_log_probrL   rj   rr   s          r8   0export_softmaxcrossentropy_mean_weights_log_probHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_log_prob  s     	 {{$$%"*%	 % 
 			qIINN1a ''

3""114"8??I((4BJJG -gD

 	w'$0		
r:   c                  Z   Sn [         R                  " S5      n[        R                  R	                  S/ SQS/U US9n[         R
                  R                  S5        [         R
                  R                  SS5      R                  [         R                  5      n[         R
                  R                  SSS	S
9R                  [         R                  5      n[         R                  " S5      US'   [         R                  " / SQ[         R                  S9n[        X4XQS9n[        UX4U/U/SS9  g )Nr   r   r<   rd   rA   rC   rD   r&   r'   r   rE   rF   rG   rf   r	   r%   r'   test_sce_mean_weight_iirL   r   rV   rO   rP   rQ   rR   rS   rT   r   r   rU   r   r9   r   r&   r'   rX   r#   rY   rl   rZ   s          r8   *export_softmaxcrossentropy_mean_weights_iiBSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii  s     	xx{ {{$$%"E% % 
 			qIINN1a ''

3""114"8??IHHQKq	((4BJJG "!GW 	w'E*		
r:   c                  b   Sn [         R                  " S5      n[        R                  R	                  S/ SQSS/U US9n[         R
                  R                  S5        [         R
                  R                  SS	5      R                  [         R                  5      n[         R
                  R                  SS	S
S9R                  [         R                  5      n[         R                  " S5      US'   [         R                  " / SQ[         R                  S9n[        X4XQSS9u  pg[        UX4U/Xg/SS9  g )Nr   r   r<   rd   rA   r1   r   r   rE   rF   rG   rf   r	   Tr%   r'   r(    test_sce_mean_weight_ii_log_probrL   r   r&   r'   rX   r#   rY   rl   r7   r1   s           r8   3export_softmaxcrossentropy_mean_weights_ii_log_probKSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_log_prob  s     	xx{ {{$$%"*%% % 
 			qIINN1a ''

3""114"8??IHHQKq	((4BJJG -gt

 	w'$3		
r:   c                     Sn [         R                  " S5      n[        R                  R	                  SSS/S/U US9n[         R
                  R                  S5        [         R
                  R                  S	S
5      R                  [         R                  5      n[         R
                  R                  SS
SS9R                  [         R                  5      n[         R                  " S5      US'   [        X4US9n[        X#U/U/SS9  g )Nr   r   r<   r#   r@   rA   r   r   r   rE   rF   rG   r'   test_sce_mean_no_weight_iirL   r   rV   rO   rP   rQ   rR   rS   rT   r   r   rU   r9   r   r&   r'   rX   r#   rY   rZ   s         r8   -export_softmaxcrossentropy_mean_no_weights_iiESoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii  s     	xx{ {{$$%:E% % 
 			qIINN1a ''

3""114"8??IHHQKq	 "!,G 	Vse:V	
r:   c                     Sn [         R                  " S5      n[        R                  R	                  SSS/SS/U US9n[         R
                  R                  S	5        [         R
                  R                  S
S5      R                  [         R                  5      n[         R
                  R                  S	SSS9R                  [         R                  5      n[         R                  " S5      US	'   [        X4USS9u  pV[        UX4/XV/SS9  g )Nr   r   r<   r#   r@   rA   r1   r   r   r   rE   rF   rG   Tr'   r(   #test_sce_mean_no_weight_ii_log_probrL   r   r&   r'   rX   r#   rY   r7   r1   s          r8   6export_softmaxcrossentropy_mean_no_weights_ii_log_probNSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_log_prob  s     	xx{ {{$$%:*%% % 
 			qIINN1a ''

3""114"8??IHHQKq	 -Lt

 	;$6		
r:   c                  b   Sn [         R                  " S5      n[        R                  R	                  S/ SQS/U US9n[         R
                  R                  S5        [         R
                  R                  SS	S
5      R                  [         R                  5      n[         R
                  R                  SS	SS9R                  [         R                  5      n[         R                  " S5      US   S'   [         R                  " / SQ[         R                  S9n[        X4XQS9n[        UX4U/U/SS9  g )Nr   r   r<   rd   rA   r   r   r   rE   r   r   rG   g?g333333?g333333?g?g      ?r	   r   test_sce_mean_weight_ii_3drL   r   r   s          r8   -export_softmaxcrossentropy_mean_weights_ii_3dESoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_3d2  s     	xx{ {{$$%"E% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	!((4BJJG "!GW 	w'E-		
r:   c                  j   Sn [         R                  " S5      n[        R                  R	                  S/ SQSS/U US9n[         R
                  R                  S5        [         R
                  R                  S	S
S5      R                  [         R                  5      n[         R
                  R                  SS
SS9R                  [         R                  5      n[         R                  " S5      US   S'   [         R                  " / SQ[         R                  S9n[        X4XQSS9u  pg[        UX4U/Xg/SS9  g )Nr   r   r<   rd   rA   r1   r   r   r   rE   r   r   rG   r   r	   Tr   #test_sce_mean_weight_ii_3d_log_probrL   r   r   s           r8   6export_softmaxcrossentropy_mean_weights_ii_3d_log_probNSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_3d_log_probS  s    	xx{ {{$$%"*%% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	!((4BJJG -gt

 	w'$6		
r:   c                     Sn [         R                  " S5      n[        R                  R	                  SSS/S/U US9n[         R
                  R                  S5        [         R
                  R                  S	S
S5      R                  [         R                  5      n[         R
                  R                  SS
SS9R                  [         R                  5      n[         R                  " S5      US   S'   [        X4US9n[        UX4/U/SS9  g )Nr   r   r<   r#   r@   rA   r   r   r   rE   r   rG   r   test_sce_mean_no_weight_ii_3drL   r   r   s         r8   0export_softmaxcrossentropy_mean_no_weights_ii_3dHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_3dv  s     	xx{ {{$$%:E% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	! "!,G 	;E0		
r:   c                     Sn [         R                  " S5      n[        R                  R	                  SSS/SS/U US9n[         R
                  R                  S	5        [         R
                  R                  S
SS5      R                  [         R                  5      n[         R
                  R                  S	SSS9R                  [         R                  5      n[         R                  " S5      US	   S	'   [        X4USS9u  pV[        UX4/XV/SS9  g )Nr   r   r<   r#   r@   rA   r1   r   r   r   rE   r   rG   Tr   &test_sce_mean_no_weight_ii_3d_log_probrL   r   r   s          r8   9export_softmaxcrossentropy_mean_no_weights_ii_3d_log_probQSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_3d_log_prob  s     	xx{ {{$$%:*%% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	! -Lt

 	;$9		
r:   c                  l   Sn [         R                  " S5      n[        R                  R	                  S/ SQS/U US9n[         R
                  R                  S5        [         R
                  R                  SS	SS
5      R                  [         R                  5      n[         R
                  R                  SS	SS9R                  [         R                  5      n[         R                  " S5      US   S   S'   [         R                  " / SQ[         R                  S9n[        X4XUS9n[        UX4U/U/SS9  g )Nr   r   r<   rd   rA   r   r   r   rE      r   r   r   rG   r   r	   )r&   r%   r'   test_sce_mean_weight_ii_4drL   r   r   s          r8   -export_softmaxcrossentropy_mean_weights_ii_4dESoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_4d  s    	xx{ {{$$%"E% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q((4BJJG "

 	w'E-		
r:   c            	      x   Sn [         R                  " S5      n[        R                  R	                  S/ SQSS/U US9n[         R
                  R                  S5        [         R
                  R                  S	S
SS5      R                  [         R                  5      n[         R
                  R                  SS
SS9R                  [         R                  5      n[         R                  " S5      US   S   S'   [         R                  " / SQ[         R                  S9n[        UUU UUSS9u  pg[        UX4U/Xg/SS9  g )Nr   r   r<   rd   rA   r1   r   r   r   rE   r   r   rG   r   r	   T)r&   r%   r'   r(   #test_sce_mean_weight_ii_4d_log_probrL   r   r   s           r8   6export_softmaxcrossentropy_mean_weights_ii_4d_log_probNSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_4d_log_prob  s    	xx{ {{$$%"*%% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q((4BJJG -%
 	w'$6		
r:   c                     Sn [         R                  " S5      n[        R                  R	                  SSS/S/U US9n[         R
                  R                  S5        [         R
                  R                  S	S
SS5      R                  [         R                  5      n[         R
                  R                  SS
SS9R                  [         R                  5      n[         R                  " S5      US   S   S'   [        X4XS9n[        UX4/U/SS9  g )Nr   r   r<   r#   r@   rA   r   r   r   rE   r   r   rG   r&   r'   test_sce_mean_no_weight_ii_4drL   r   r   s         r8   0export_softmaxcrossentropy_mean_no_weights_ii_4dHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_4d  s     	xx{ {{$$%:E% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q "

 	;E0		
r:   c                  &   Sn [         R                  " S5      n[        R                  R	                  SSS/SS/U US9n[         R
                  R                  S	5        [         R
                  R                  S
SSS5      R                  [         R                  5      n[         R
                  R                  S	SSS9R                  [         R                  5      n[         R                  " S5      US	   S	   S	'   [        X4XSS9u  pV[        UX4/XV/SS9  g )Nr   r   r<   r#   r@   rA   r1   r   r   r   rE   r   r   rG   Tr&   r'   r(   &test_sce_mean_no_weight_ii_4d_log_probrL   r   r   s          r8   9export_softmaxcrossentropy_mean_no_weights_ii_4d_log_probQSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_4d_log_prob%  s     	xx{ {{$$%:*%% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q -TX

 	;$9		
r:   c            
      @   Sn [         R                  R                  S/ SQS/U S9nSu  p#pEpgn[        R                  R                  S5        [        R                  R                  X#XEXgU5      R                  [        R                  5      n	[        R                  R                  SX2XEXgU4S9R                  [        R                  5      n
[        R                  R                  U5      R                  [        R                  5      n[        XXS	9n[        UXU/U/S
S9  g )Nr   r<   rd   rA   rB   r   rE      r   rE   r      r   rG   rh   !test_sce_NCd1d2d3d4d5_mean_weightrL   rN   )r&   rX   r+   r,   dim1dim2dim3dim4dim5r#   rY   r%   rZ   s                r8   .export_input_shape_is_NCd1d2d3d4d5_mean_weightFSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_mean_weightG  s    	{{$$%"E	 % 
 .A*d$d
		qIINN1T>EEbjjQ""AD= # 

&
 	 "))"**5!!FPv&E4		
r:   c            
      H   Sn [         R                  R                  S/ SQSS/U S9nSu  p#pEpgn[        R                  R                  S5        [        R                  R                  X#XEXgU5      R                  [        R                  5      n	[        R                  R                  SX2XEXgU4S	9R                  [        R                  5      n
[        R                  R                  U5      R                  [        R                  5      n[        XXS
S9u  p[        UXU/X/SS9  g )Nr   r<   rd   rA   r1   rB   r   r   rG   Trp   *test_sce_NCd1d2d3d4d5_mean_weight_log_probrL   rN   )r&   rX   r+   r,   r   r   r   r   r   r#   rY   r%   r7   r1   s                 r8   7export_input_shape_is_NCd1d2d3d4d5_mean_weight_log_probOSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_mean_weight_log_probc  s   	{{$$%"*%	 % 
 .A*d$d
		qIINN1T>EEbjjQ""AD= # 

&
 	 "))"**5,f
 	v&$=		
r:   c            
         Sn [         R                  R                  SSS/S/U S9nSu  p#pEpgn[        R                  R                  S5        [        R                  R                  X#XEXgU5      R                  [        R                  5      n	[        R                  R                  SX2XEXgU4S	9R                  [        R                  5      n
[        XU S
9n[        UX/U/SS9  g )Nr?   r<   r#   r@   rA   rB   r   r   rG   rJ   $test_sce_NCd1d2d3d4d5_none_no_weightrL   rN   )r&   rX   r+   r,   r   r   r   r   r   r#   rY   rZ   s               r8   1export_input_shape_is_NCd1d2d3d4d5_none_no_weightISoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_none_no_weight  s    	{{$$%:E	 % 
 .A*d$d
		qIINN1T>EEbjjQ""AD= # 

&
 	 "!yA;E7		
r:   c            
         Sn [         R                  R                  SSS/SS/U S9nSu  p#pEpgn[        R                  R                  S	5        [        R                  R                  X#XEXgU5      R                  [        R                  5      n	[        R                  R                  S	X2XEXgU4S
9R                  [        R                  5      n
[        XU SS9u  p[        UX/X/SS9  g )Nr?   r<   r#   r@   rA   r1   rB   r   r   rG   Tr^   -test_sce_NCd1d2d3d4d5_none_no_weight_log_probrL   rN   )r&   rX   r+   r,   r   r   r   r   r   r#   rY   r7   r1   s                r8   :export_input_shape_is_NCd1d2d3d4d5_none_no_weight_log_probRSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_none_no_weight_log_prob  s    	{{$$%:*%	 % 
 .A*d$d
		qIINN1T>EEbjjQ""AD= # 

&
 	 -
 	;$@		
r:   c                  t   Sn [         R                  " S5      n[        R                  R	                  S/ SQS/U US9nSu  p4n[         R
                  R                  S5        [         R
                  R                  X4U5      R                  [         R                  5      n[         R
                  R                  SXCU4S	9R                  [         R                  5      nSUS   S'   [         R
                  R                  U5      R                  [         R                  5      n[        XgXUS
9n	[        UXgU/U	/SS9  g )Nr   r   r<   rd   rA   r   r   rE   r   r   rG   r%   r&   r'   %test_sce_NCd1_mean_weight_negative_iirL   r   )
r&   r'   rX   r+   r,   r   r#   rY   r%   rZ   s
             r8   2export_input_shape_is_NCd1_mean_weight_negative_iiJSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1_mean_weight_negative_ii  s   	xx|{{$$%"E% % 
 
d
		qIINN1&--bjj9""11t9"=DDRXXNq	!"))"**5!f
 	v&E8		
r:   c            	         Sn [         R                  " S5      n[        R                  R	                  S/ SQSS/U US9nSu  p4n[         R
                  R                  S	5        [         R
                  R                  X4U5      R                  [         R                  5      n[         R
                  R                  S	XCU4S
9R                  [         R                  5      nSUS	   S	'   [         R
                  R                  U5      R                  [         R                  5      n[        UUUU USS9u  p[        UXgU/X/SS9  g )Nr   r   r<   rd   rA   r1   r   r   r   rG   Tr%   r&   r'   r(   .test_sce_NCd1_mean_weight_negative_ii_log_probrL   r   )r&   r'   rX   r+   r,   r   r#   rY   r%   r7   r1   s              r8   ;export_input_shape_is_NCd1_mean_weight_negative_ii_log_probSSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1_mean_weight_negative_ii_log_prob  s   	xx|{{$$%"*%% % 
 
d
		qIINN1&--bjj9""11t9"=DDRXXNq	!"))"**5,%
 	v&$A		
r:   c                  
   Sn [         R                  " S5      n[        R                  R	                  SSS/S/U US9nSu  p4pVn[         R
                  R                  S	5        [         R
                  R                  X4XVU5      R                  [         R                  5      n[         R
                  R                  S	XCXVU4S
9R                  [         R                  5      n	SU	S	   S	   S	   S	'   [        XXS9n
[        UX/U
/SS9  g )Nr?   r<   r#   r@   rA   r   r   rE   r   r   rE   r   rG   r   ,test_sce_NCd1d2d3_none_no_weight_negative_iirL   r   )r&   r'   rX   r+   r,   r   r   r   r#   rY   rZ   s              r8   9export_input_shape_is_NCd1d2d3_none_no_weight_negative_iiQSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_none_no_weight_negative_ii  s    	xx|{{$$%:E% % 
 "/d$
		qIINN1T299"**E""11t43H"IPPHH
  q	!Q!
 	;E?		
r:   c                     Sn [         R                  " S5      n[        R                  R	                  SSS/SS/U US9nS	u  p4pVn[         R
                  R                  S
5        [         R
                  R                  X4XVU5      R                  [         R                  5      n[         R
                  R                  S
XCXVU4S9R                  [         R                  5      n	SU	S
   S
   S
   S
'   [        XXSS9u  p[        UX/X/SS9  g )Nr?   r   r<   r#   r@   rA   r1   r   r   r   rG   Tr   5test_sce_NCd1d2d3_none_no_weight_negative_ii_log_probrL   r   )r&   r'   rX   r+   r,   r   r   r   r#   rY   r7   r1   s               r8   Bexport_input_shape_is_NCd1d2d3_none_no_weight_negative_ii_log_probZSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_none_no_weight_negative_ii_log_prob  s   	xx|{{$$%:*%% % 
 "/d$
		qIINN1T299"**E""11t43H"IPPHH
  q	!Q,TX
 	;$H		
r:   c                  f   Sn [         R                  " S5      n[        R                  R	                  S/ SQS/U US9nSu  p4[         R
                  R                  S5        [         R
                  R                  X45      R                  [         R                  5      n[         R
                  R                  SXCS	9R                  [         R                  5      nSUS'   [         R
                  R                  U5      R                  [         R                  5      n[        XVXpUS
9n[        UXVU/U/SS9  g )Nr   
   r<   rd   rA   r   r   rE   r   rG   r   $test_sce_NCd1d2d3_sum_weight_high_iirL   r   )	r&   r'   rX   r+   r,   r#   rY   r%   rZ   s	            r8   1export_input_shape_is_NCd1d2d3_sum_weight_high_iiISoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_sum_weight_high_ii<  s    	xx|{{$$%"E% % 
 
		qIINN1 ''

3""11"7>>rxxHq	"))"**5!f
 	v&E7		
r:   c            	      r   Sn [         R                  " S5      n[        R                  R	                  S/ SQSS/U US9nSu  p4[         R
                  R                  S	5        [         R
                  R                  X45      R                  [         R                  5      n[         R
                  R                  S	XCS
9R                  [         R                  5      nSUS	'   [         R
                  R                  U5      R                  [         R                  5      n[        UUUU USS9u  p[        UXVU/X/SS9  g )Nr   r  r<   rd   rA   r1   r   r  r   rG   Tr   -test_sce_NCd1d2d3_sum_weight_high_ii_log_probrL   r   )
r&   r'   rX   r+   r,   r#   rY   r%   r7   r1   s
             r8   :export_input_shape_is_NCd1d2d3_sum_weight_high_ii_log_probRSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_sum_weight_high_ii_log_prob[  s	   	xx|{{$$%"*%% % 
 
		qIINN1 ''

3""11"7>>rxxHq	"))"**5,%
 	v&$@		
r:    )returnN)(__name__
__module____qualname____firstlineno__staticmethodr[   ra   rm   rs   rw   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  __static_attributes__r  r:   r8   r<   r<   Z   s   N N. 
 
< 
 
: 
 
> M M. 
 
< N N. 
 
8 L L. 
 
8 
 
: 
 
> 
 
@  
  
D 
 
8 
 
B 
 
@  
  
D 
 
> 
 
B  
  
D %
 %
N 
 
B 
 
B 
 
6 
 
: 
 
4 
 
8 
 
< !
 !
F 
 
> 
 
> 
 
< !
 !
r:   r<   )Nr   NN)	numpyr   rO   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r9   r<   r  r:   r8   <module>r     s(   
   , .K\c
d c
r:   