
    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Z	 G d de      Z
y)	    )annotationsN)Base)expectc                ^   | j                   }t        |      dk(  rt        d      |j                   }|d   }|d   }	t        j                  | dd      }
t        j
                  | |
z
        }|t        j                  |dd      z  }t        j                  |      }d }|du rt        j                  |      }d }|vt        j                  |t        j                  |t        j                        d      }|st        j                  ||k(  d|      j                  t        j                        }n:|8t        j                  ||k(  dd      j                  t        j                        }t        |      d	k7  r'|j                  ||	d
f      }|j                  |d
f      }|j                   d   }t        j                   ||ft        j                        }t#        |      D ]6  }t#        |      D ]&  }||   |   |k7  s||   ||   |      |    ||   |<   ( 8 |}t        |      d	k7  r|j                  |      }|5||z  }|dk(  r+|j                         |j                         z  }|du r||fS |S |dk(  rt        j$                  |      }n|dk(  rt        j                  |      }|r||fS |S )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                        l/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/softmaxcrossentropy.pysoftmaxcrossentropyr:      s    ''K
;1.//<<LAAAA FF11t,EFF1u9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kk1a*%B( 			!A!xxAbjjA1X Jq 	JAay||+25a&12Fq2I1I(+A.	JJ
 $D ;1||L)  t#88: 1 1 33Dt#X~%Fwwt}	e	vvd|X~K    c                  p   e Zd Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Z	ed$d       Z
ed$d       Zed$d	       Zed$d
       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Zed$d       Z ed$d       Z!ed$d       Z"ed$d        Z#ed$d!       Z$ed$d"       Z%y#)%SoftmaxCrossEntropyLossc                    d} t         j                  j                  dddgdg|       }t        j                  j                  d       t        j                  j                  dd	      j                  t        j                        }t        j                  j                  dd	d
      j                  t        j                        }t        ||d      }t        |||g|gd       y )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int64r:   r   r'   noder$   labelssces        r9   export_softmaxcrossentropy_nonez7SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none^   s     	 {{$$%:E	 % 
 			qIINN1a ''

3""114"8??I "!Vv> 	tQK#_Mr;   c                    d} t         j                  j                  dddgddg|       }t        j                  j                  d       t        j                  j                  d	d
      j                  t        j                        }t        j                  j                  dd
d      j                  t        j                        }t        ||dd      \  }}t        |||g||gd       y )Nr?   r=   r$   r@   rA   r2   rB   r   r   rE   rF   rG   Tr'   r)   test_sce_none_log_probrL   rN   r'   rX   r$   rY   r8   r2   s         r9   (export_softmaxcrossentropy_none_log_probz@SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none_log_probv   s     	 {{$$%:*%	 % 
 			qIINN1a ''

3""114"8??I -vd
h
 	v;8$)		
r;   c                    d} t         j                  j                  dg ddg|       }t        j                  j                  d       t        j                  j                  dd      j                  t        j                        }t        j                  j                  ddd	
      j                  t        j                        }t        j                  g dt        j                        }t        |||d      }t        ||||g|gd       y )Nr?   r=   r$   r@   wrA   rB   r   r   rE   rF   rG   ?gffffff?g?re   re   r
   r&   r'   test_sce_none_weightsrL   rO   rP   rQ   r   rR   rS   rT   r   r    rU   rV   r   r:   r   r'   rX   r$   rY   weightsrZ   s         r9   'export_softmaxcrossentropy_none_weightsz?SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none_weights   s     	 {{$$%"E	 % 
 			qIINN1a ''

3""114"8??I((4BJJG "!VGvN 	vw'E(		
r;   c                 (   d} t         j                  j                  dg dddg|       }t        j                  j                  d       t        j                  j                  dd	      j                  t        j                        }t        j                  j                  dd	d
      j                  t        j                        }t        j                  g dt        j                        }t        |||dd      \  }}t        ||||g||gd       y )Nr?   r=   rb   rA   r2   rB   r   r   rE   rF   rG   rd   r
   Tr&   r'   r)   test_sce_none_weights_log_probrL   rh   r'   rX   r$   rY   rj   r8   r2   s          r9   0export_softmaxcrossentropy_none_weights_log_probzHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_none_weights_log_prob   s     	 {{$$%"*%	 % 
 			qIINN1a ''

3""114"8??I((4BJJG -vgd
h
 	vw'8$1		
r;   c                    d} t         j                  j                  dddgdg|       }t        j                  j                  d       t        j                  j                  dd	      j                  t        j                        }t        j                  j                  dd	d
      j                  t        j                        }t        ||d      }t        |||g|gd       y )Nr   r=   r$   r@   rA   rB   r   r   rE   rF   rG   rJ   test_sce_sumrL   rN   rW   s        r9   export_softmaxcrossentropy_sumz6SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_sum   s     	 {{$$%:E	 % 
 			qIINN1a ''

3""114"8??I "!Vu= 	tQK#^Lr;   c                    d} t         j                  j                  dddgddg|       }t        j                  j                  d       t        j                  j                  d	d
      j                  t        j                        }t        j                  j                  dd
d      j                  t        j                        }t        ||dd      \  }}t        |||g||gd       y )Nr   r=   r$   r@   rA   r2   rB   r   r   rE   rF   rG   Tr]   test_sce_sum_log_probrL   rN   r_   s         r9   'export_softmaxcrossentropy_sum_log_probz?SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_sum_log_prob   s     	 {{$$%:*%	 % 
 			qIINN1a ''

3""114"8??I -vT
h
 	v;8$(		
r;   c                    d} t         j                  j                  dddgdg|       }t        j                  j                  d       t        j                  j                  dd	      j                  t        j                        }t        j                  j                  dd	d
      j                  t        j                        }t        ||      }t        |||g|gd       y )Nr   r=   r$   r@   rA   rB   r   r   rE   rF   rG   test_sce_meanrL   rN   rW   s        r9   export_softmaxcrossentropy_meanz7SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean
  s     	 {{$$%:E	 % 
 			qIINN1a ''

3""114"8??I "!V, 	tQK#_Mr;   c                    d} t         j                  j                  dddgddg|       }t        j                  j                  d       t        j                  j                  d	d
      j                  t        j                        }t        j                  j                  dd
d      j                  t        j                        }t        ||d      \  }}t        |||g||gd       y )Nr   r=   r$   r@   rA   r2   rB   r   r   rE   rF   rG   Tr)   test_sce_mean_log_probrL   rN   r_   s         r9   (export_softmaxcrossentropy_mean_log_probz@SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_log_prob"  s     	 {{$$%:*%	 % 
 			qIINN1a ''

3""114"8??I -QTJh 	v;8$)		
r;   c                    d} t         j                  j                  dddgdg|       }t        j                  j                  d       t        j                  j                  dd	d
      j                  t        j                        }t        j                  j                  dd	d      j                  t        j                        }t        ||      }t        |||g|gd       y )Nr   r=   r$   r@   rA   rB   r   r   rE   r   r   r   rG   test_sce_mean_3drL   rN   )r'   rX   r$   r@   rZ   s        r9   "export_softmaxcrossentropy_mean_3dz:SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_3d?  s     	 {{$$%:E	 % 
 			qIINN1a#**2::6IIaaf5<<RXXF "!Q' 	tQFSE8JKr;   c                    d} t         j                  j                  dddgddg|       }t        j                  j                  d       t        j                  j                  d	d
d      j                  t        j                        }t        j                  j                  dd
d      j                  t        j                        }t        ||d      \  }}t        |||g||gd       y )Nr   r=   r$   r@   rA   r2   rB   r   r   rE   r   r   rG   Tr{   test_sce_mean_3d_log_probrL   rN   )r'   rX   r$   r@   r8   r2   s         r9   +export_softmaxcrossentropy_mean_3d_log_probzCSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_3d_log_probW  s     	 {{$$%:*%	 % 
 			qIINN1a#**2::6IIaaf5<<RXXF -QEh 	q68$,		
r;   c                    d} t         j                  j                  dg ddg|       }t        j                  j                  d       t        j                  j                  dd      j                  t        j                        }t        j                  j                  ddd	
      j                  t        j                        }t        j                  g dt        j                        }t        |||      }t        ||||g|gd       y )Nr   r=   rb   rA   rB   r   r   rE   rF   rG   rd   r
   )r&   test_sce_mean_weightrL   rh   ri   s         r9   'export_softmaxcrossentropy_mean_weightsz?SoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weightst  s     	 {{$$%"E	 % 
 			qIINN1a ''

3""114"8??I((4BJJG "!VG< 	vw'E'		
r;   c                 &   d} t         j                  j                  dg dddg|       }t        j                  j                  d       t        j                  j                  dd	      j                  t        j                        }t        j                  j                  dd	d
      j                  t        j                        }t        j                  g dt        j                        }t        |||d      \  }}t        ||||g||gd       y )Nr   r=   rb   rA   r2   rB   r   r   rE   rF   rG   rd   r
   T)r&   r)   test_sce_mean_weight_log_probrL   rh   ro   s          r9   0export_softmaxcrossentropy_mean_weights_log_probzHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_log_prob  s     	 {{$$%"*%	 % 
 			qIINN1a ''

3""114"8??I((4BJJG -vgD
h
 	vw'8$0		
r;   c                 x   d} t        j                  d      }t        j                  j	                  dg ddg| |      }t         j
                  j                  d       t         j
                  j                  dd      j                  t         j                        }t         j
                  j                  ddd	
      j                  t         j                        }t        j                  d      |d<   t        j                  g dt         j                        }t        ||||      }t        ||||g|gd       y )Nr   r   r=   rb   rA   rC   rD   r'   r(   r   rE   rF   rG   rd   r
   r&   r(   test_sce_mean_weight_iirL   r   rV   rO   rP   rQ   rR   rS   rT   r   r    rU   r   r:   r   r'   r(   rX   r$   rY   rj   rZ   s          r9   *export_softmaxcrossentropy_mean_weights_iizBSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii  s     	xx{ {{$$%"E% % 
 			qIINN1a ''

3""114"8??IHHQKq	((4BJJG "!VG,W 	vw'E*		
r;   c                    d} t        j                  d      }t        j                  j	                  dg dddg| |      }t         j
                  j                  d       t         j
                  j                  dd	      j                  t         j                        }t         j
                  j                  dd	d
      j                  t         j                        }t        j                  d      |d<   t        j                  g dt         j                        }t        ||||d      \  }}t        ||||g||gd       y )Nr   r   r=   rb   rA   r2   r   r   rE   rF   rG   rd   r
   Tr&   r(   r)    test_sce_mean_weight_ii_log_probrL   r   r'   r(   rX   r$   rY   rj   r8   r2   s           r9   3export_softmaxcrossentropy_mean_weights_ii_log_probzKSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_log_prob  s    	xx{ {{$$%"*%% % 
 			qIINN1a ''

3""114"8??IHHQKq	((4BJJG -vgLt
h
 	vw'8$3		
r;   c                 &   d} t        j                  d      }t        j                  j	                  dddgdg| |      }t         j
                  j                  d       t         j
                  j                  d	d
      j                  t         j                        }t         j
                  j                  dd
d      j                  t         j                        }t        j                  d      |d<   t        |||      }t        |||g|gd       y )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   r:   r   r'   r(   rX   r$   rY   rZ   s         r9   -export_softmaxcrossentropy_mean_no_weights_iizESoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii  s     	xx{ {{$$%:E% % 
 			qIINN1a ''

3""114"8??IHHQKq	 "!V,G 	!Vse:V	
r;   c                 2   d} t        j                  d      }t        j                  j	                  dddgddg| |      }t         j
                  j                  d	       t         j
                  j                  d
d      j                  t         j                        }t         j
                  j                  d	dd      j                  t         j                        }t        j                  d      |d	<   t        |||d      \  }}t        |||g||gd       y )Nr   r   r=   r$   r@   rA   r2   r   r   r   rE   rF   rG   Tr(   r)   #test_sce_mean_no_weight_ii_log_probrL   r   r'   r(   rX   r$   rY   r8   r2   s          r9   6export_softmaxcrossentropy_mean_no_weights_ii_log_probzNSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_log_prob  s     	xx{ {{$$%:*%% % 
 			qIINN1a ''

3""114"8??IHHQKq	 -vLt
h
 	v;8$6		
r;   c                    d} t        j                  d      }t        j                  j	                  dg ddg| |      }t         j
                  j                  d       t         j
                  j                  dd	d
      j                  t         j                        }t         j
                  j                  dd	d      j                  t         j                        }t        j                  d      |d   d<   t        j                  g dt         j                        }t        ||||      }t        ||||g|gd       y )Nr   r   r=   rb   rA   r   r   r   rE   r   r   rG   g?g333333?g333333?g?g      ?r
   r   test_sce_mean_weight_ii_3drL   r   r   s          r9   -export_softmaxcrossentropy_mean_weights_ii_3dzESoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_3d5  s     	xx{ {{$$%"E% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	!((4BJJG "!VG,W 	vw'E-		
r;   c                    d} t        j                  d      }t        j                  j	                  dg dddg| |      }t         j
                  j                  d       t         j
                  j                  d	d
d      j                  t         j                        }t         j
                  j                  dd
d      j                  t         j                        }t        j                  d      |d   d<   t        j                  g dt         j                        }t        ||||d      \  }}t        ||||g||gd       y )Nr   r   r=   rb   rA   r2   r   r   r   rE   r   r   rG   r   r
   Tr   #test_sce_mean_weight_ii_3d_log_probrL   r   r   s           r9   6export_softmaxcrossentropy_mean_weights_ii_3d_log_probzNSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_3d_log_probV  s    	xx{ {{$$%"*%% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	!((4BJJG -vgLt
h
 	vw'8$6		
r;   c                 .   d} t        j                  d      }t        j                  j	                  dddgdg| |      }t         j
                  j                  d       t         j
                  j                  d	d
d      j                  t         j                        }t         j
                  j                  dd
d      j                  t         j                        }t        j                  d      |d   d<   t        |||      }t        |||g|gd       y )Nr   r   r=   r$   r@   rA   r   r   r   rE   r   rG   r   test_sce_mean_no_weight_ii_3drL   r   r   s         r9   0export_softmaxcrossentropy_mean_no_weights_ii_3dzHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_3dy  s     	xx{ {{$$%:E% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	! "!V,G 	v;E0		
r;   c                 :   d} t        j                  d      }t        j                  j	                  dddgddg| |      }t         j
                  j                  d	       t         j
                  j                  d
dd      j                  t         j                        }t         j
                  j                  d	dd      j                  t         j                        }t        j                  d      |d	   d	<   t        |||d      \  }}t        |||g||gd       y )Nr   r   r=   r$   r@   rA   r2   r   r   r   rE   r   rG   Tr   &test_sce_mean_no_weight_ii_3d_log_probrL   r   r   s          r9   9export_softmaxcrossentropy_mean_no_weights_ii_3d_log_probzQSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_3d_log_prob  s     	xx{ {{$$%:*%% % 
 			qIINN1a#**2::6""116":AA"((Kxx{q	! -vLt
h
 	v;8$9		
r;   c                    d} t        j                  d      }t        j                  j	                  dg ddg| |      }t         j
                  j                  d       t         j
                  j                  dd	dd
      j                  t         j                        }t         j
                  j                  dd	d      j                  t         j                        }t        j                  d      |d   d   d<   t        j                  g dt         j                        }t        ||| ||      }t        ||||g|gd       y )Nr   r   r=   rb   rA   r   r   r   rE      r   r   r   rG   r   r
   )r'   r&   r(   test_sce_mean_weight_ii_4drL   r   r   s          r9   -export_softmaxcrossentropy_mean_weights_ii_4dzESoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_4d  s	    	xx{ {{$$%"E% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q((4BJJG "v7

 	vw'E-		
r;   c                    d} t        j                  d      }t        j                  j	                  dg dddg| |      }t         j
                  j                  d       t         j
                  j                  d	d
dd      j                  t         j                        }t         j
                  j                  dd
d      j                  t         j                        }t        j                  d      |d   d   d<   t        j                  g dt         j                        }t        ||| ||d      \  }}t        ||||g||gd       y )Nr   r   r=   rb   rA   r2   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           r9   6export_softmaxcrossentropy_mean_weights_ii_4d_log_probzNSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_weights_ii_4d_log_prob  s    	xx{ {{$$%"*%% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q((4BJJG -%
h 	vw'8$6		
r;   c                 8   d} t        j                  d      }t        j                  j	                  dddgdg| |      }t         j
                  j                  d       t         j
                  j                  d	d
dd      j                  t         j                        }t         j
                  j                  dd
d      j                  t         j                        }t        j                  d      |d   d   d<   t        ||| |      }t        |||g|gd       y )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         r9   0export_softmaxcrossentropy_mean_no_weights_ii_4dzHSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_4d  s     	xx{ {{$$%:E% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q "v

 	v;E0		
r;   c                 D   d} t        j                  d      }t        j                  j	                  dddgddg| |      }t         j
                  j                  d	       t         j
                  j                  d
ddd      j                  t         j                        }t         j
                  j                  d	dd      j                  t         j                        }t        j                  d      |d	   d	   d	<   t        ||| |d      \  }}t        |||g||gd       y )Nr   r   r=   r$   r@   rA   r2   r   r   r   rE   r   r   rG   Tr'   r(   r)   &test_sce_mean_no_weight_ii_4d_log_probrL   r   r   s          r9   9export_softmaxcrossentropy_mean_no_weights_ii_4d_log_probzQSoftmaxCrossEntropyLoss.export_softmaxcrossentropy_mean_no_weights_ii_4d_log_prob(  s     	xx{ {{$$%:*%% % 
 			qIINN1aA&--bjj9""119"=DDRXXN((1+q	!Q -vTX
h
 	v;8$9		
r;   c            
     p   d} t         j                  j                  dg ddg|       }d\  }}}}}}}t        j                  j                  d       t        j                  j                  |||||||      j                  t        j                        }	t        j                  j                  d|||||||f      j                  t        j                        }
t        j                  j                  |      j                  t        j                        }t        |	|
|| 	      }t        ||	|
|g|gd
       y )Nr   r=   rb   rA   rB   r   rE      r   rE   r      r   rG   rf   !test_sce_NCd1d2d3d4d5_mean_weightrL   rN   )r'   rX   r,   r-   dim1dim2dim3dim4dim5r$   rY   r&   rZ   s                r9   .export_input_shape_is_NCd1d2d3d4d5_mean_weightzFSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_mean_weightJ  s   	{{$$%"E	 % 
 .A*1dD$d
		qIINN1atT4>EEbjjQ""AQdD$= # 

&
 	 "))"**5!!VFiPvv&E4		
r;   c            
     |   d} t         j                  j                  dg dddg|       }d\  }}}}}}}t        j                  j                  d       t        j                  j                  |||||||      j                  t        j                        }	t        j                  j                  d|||||||f	      j                  t        j                        }
t        j                  j                  |      j                  t        j                        }t        |	|
|| d
      \  }}t        ||	|
|g||gd       y )Nr   r=   rb   rA   r2   rB   r   r   rG   Trm   *test_sce_NCd1d2d3d4d5_mean_weight_log_probrL   rN   )r'   rX   r,   r-   r   r   r   r   r   r$   rY   r&   r8   r2   s                 r9   7export_input_shape_is_NCd1d2d3d4d5_mean_weight_log_probzOSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_mean_weight_log_probf  s!   	{{$$%"*%	 % 
 .A*1dD$d
		qIINN1atT4>EEbjjQ""AQdD$= # 

&
 	 "))"**5,vf	
h 	vv&8$=		
r;   c            
        d} t         j                  j                  dddgdg|       }d\  }}}}}}}t        j                  j                  d       t        j                  j                  |||||||      j                  t        j                        }	t        j                  j                  d|||||||f	      j                  t        j                        }
t        |	|
| 
      }t        ||	|
g|gd       y )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               r9   1export_input_shape_is_NCd1d2d3d4d5_none_no_weightzISoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_none_no_weight  s    	{{$$%:E	 % 
 .A*1dD$d
		qIINN1atT4>EEbjjQ""AQdD$= # 

&
 	 "!VyAv;E7		
r;   c            
         d} t         j                  j                  dddgddg|       }d\  }}}}}}}t        j                  j                  d	       t        j                  j                  |||||||      j                  t        j                        }	t        j                  j                  d	|||||||f
      j                  t        j                        }
t        |	|
| d      \  }}t        ||	|
g||gd       y )Nr?   r=   r$   r@   rA   r2   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   r8   r2   s                r9   :export_input_shape_is_NCd1d2d3d4d5_none_no_weight_log_probzRSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3d4d5_none_no_weight_log_prob  s    	{{$$%:*%	 % 
 .A*1dD$d
		qIINN1atT4>EEbjjQ""AQdD$= # 

&
 	 -v
h 	v;8$@		
r;   c                    d} t        j                  d      }t        j                  j	                  dg ddg| |      }d\  }}}t         j
                  j                  d       t         j
                  j                  |||      j                  t         j                        }t         j
                  j                  d|||f	      j                  t         j                        }d|d   d<   t         j
                  j                  |      j                  t         j                        }t        |||| |
      }	t        ||||g|	gd       y )Nr   r   r=   rb   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
             r9   2export_input_shape_is_NCd1_mean_weight_negative_iizJSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1_mean_weight_negative_ii  s   	xx|{{$$%"E% % 
 
1d
		qIINN1a&--bjj9""11At9"=DDRXXNq	!"))"**5!vf	
 	vv&E8		
r;   c                    d} t        j                  d      }t        j                  j	                  dg dddg| |      }d\  }}}t         j
                  j                  d	       t         j
                  j                  |||      j                  t         j                        }t         j
                  j                  d	|||f
      j                  t         j                        }d|d	   d	<   t         j
                  j                  |      j                  t         j                        }t        |||| |d      \  }	}
t        ||||g|	|
gd       y )Nr   r   r=   rb   rA   r2   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&   r8   r2   s              r9   ;export_input_shape_is_NCd1_mean_weight_negative_ii_log_probzSSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1_mean_weight_negative_ii_log_prob  s!   	xx|{{$$%"*%% % 
 
1d
		qIINN1a&--bjj9""11At9"=DDRXXNq	!"))"**5,%
h 	vv&8$A		
r;   c                 2   d} t        j                  d      }t        j                  j	                  dddgdg| |      }d\  }}}}}t         j
                  j                  d	       t         j
                  j                  |||||      j                  t         j                        }t         j
                  j                  d	|||||f
      j                  t         j                        }	d|	d	   d	   d	   d	<   t        ||	| |      }
t        |||	g|
gd       y )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              r9   9export_input_shape_is_NCd1d2d3_none_no_weight_negative_iizQSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_none_no_weight_negative_ii  s
   	xx|{{$$%:E% % 
 "/1dD$
		qIINN1atT299"**E""11AtT43H"IPPHH
  q	!Q!v
 	v;E?		
r;   c                 >   d} t        j                  d      }t        j                  j	                  dddgddg| |      }d	\  }}}}}t         j
                  j                  d
       t         j
                  j                  |||||      j                  t         j                        }t         j
                  j                  d
|||||f      j                  t         j                        }	d|	d
   d
   d
   d
<   t        ||	| |d      \  }
}t        |||	g|
|gd       y )Nr?   r   r=   r$   r@   rA   r2   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   r8   r2   s               r9   Bexport_input_shape_is_NCd1d2d3_none_no_weight_negative_ii_log_probzZSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_none_no_weight_negative_ii_log_prob  s   	xx|{{$$%:*%% % 
 "/1dD$
		qIINN1atT299"**E""11AtT43H"IPPHH
  q	!Q,vTX
h 	v;8$H		
r;   c                    d} t        j                  d      }t        j                  j	                  dg ddg| |      }d\  }}t         j
                  j                  d       t         j
                  j                  ||      j                  t         j                        }t         j
                  j                  d||	      j                  t         j                        }d|d<   t         j
                  j                  |      j                  t         j                        }t        |||| |
      }t        ||||g|gd       y )Nr   
   r=   rb   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	            r9   1export_input_shape_is_NCd1d2d3_sum_weight_high_iizISoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_sum_weight_high_ii?  s   	xx|{{$$%"E% % 
 1
		qIINN1a ''

3""11A"7>>rxxHq	"))"**5!vf	
 	vv&E7		
r;   c                    d} t        j                  d      }t        j                  j	                  dg dddg| |      }d\  }}t         j
                  j                  d	       t         j
                  j                  ||      j                  t         j                        }t         j
                  j                  d	||
      j                  t         j                        }d|d	<   t         j
                  j                  |      j                  t         j                        }t        |||| |d      \  }}	t        ||||g||	gd       y )Nr   r   r=   rb   rA   r2   r   r   r   rG   Tr   -test_sce_NCd1d2d3_sum_weight_high_ii_log_probrL   r   )
r'   r(   rX   r,   r-   r$   rY   r&   r8   r2   s
             r9   :export_input_shape_is_NCd1d2d3_sum_weight_high_ii_log_probzRSoftmaxCrossEntropyLoss.export_input_shape_is_NCd1d2d3_sum_weight_high_ii_log_prob^  s   	xx|{{$$%"*%% % 
 1
		qIINN1a ''

3""11A"7>>rxxHq	"))"**5,%
h 	vv&8$@		
r;   N)returnNone)&__name__
__module____qualname__staticmethodr[   r`   rk   rp   rs   rv   ry   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;   r9   r=   r=   ]   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)
__future__r   numpyr   rO   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r:   r=   r   r;   r9   <module>r      s2    #   , . OSM`c
d c
r;   