
    bIg                    N    d dl mZ d dlZd dlZd dlmZ d dlmZ  G d de      Z	y)    )annotationsN)Base)expectc                      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y	)Slicec                 B   t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }|dd	ddf   }t        j                  ddgt        j                  
      }t        j                  d	dgt        j                  
      }t        j                  ddgt        j                  
      }t        j                  ddgt        j                  
      }t        | |||||g|gd       y )Nr   xstartsendsaxesstepsyinputsoutputs   
      r      dtype   
test_slicer   r   nameonnxhelper	make_nodenprandomrandnastypefloat32arrayint64r   )noder
   r   r   r   r   r   s          ^/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/slice.pyexport_slicezSlice.export_slice   s    {{$$;E % 
 IIOOBA&--bjj9ac1R4iL1a&1xxBrxx0xxAbhh/!Qrxx0!VT47!<	
    c                 :   t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  dgt        j                  	      }t        j                  d
gt        j                  	      }t        j                  dgt        j                  	      }t        j                  dgt        j                  	      }|d d dd
f   }t        | |||||g|gd       y )Nr   r	   r   r   r   r   r   r   r   r   test_slice_negr   r   r(   r
   r   r   r   r   r   s          r)   export_slice_negzSlice.export_slice_neg!   s    {{$$;E % 
 IIOOBA&--bjj91#RXX.xxBHH-xx288,!BHH-a2gJvtT51C!		
r+   c                 :   t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  dgt        j                  	      }t        j                  dgt        j                  	      }t        j                  d
gt        j                  	      }t        j                  d
gt        j                  	      }|d d ddf   }t        | |||||g|gd       y )Nr   r	   r   r   r   r   r     r   r   test_slice_start_out_of_boundsr   r   r/   s          r)    export_slice_start_out_of_boundsz&Slice.export_slice_start_out_of_bounds7   s    {{$$;E % 
 IIOOBA&--bjj94&1xxbhh/xx288,!BHH-adlOvtT51C1		
r+   c                 :   t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  dgt        j                  	      }t        j                  d
gt        j                  	      }t        j                  dgt        j                  	      }t        j                  dgt        j                  	      }|d d dd
f   }t        | |||||g|gd       y )Nr   r	   r   r   r   r   r   r   r   r2   test_slice_end_out_of_boundsr   r   r/   s          r)   export_slice_end_out_of_boundsz$Slice.export_slice_end_out_of_boundsM   s    {{$$;E % 
 IIOOBA&--bjj91#RXX.xxbhh/xx288,!BHH-a4iLvtT51C/		
r+   c                    t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  g dt        j                  	      }t        j                  g d
t        j                  	      }|d d d d ddf   }t        | |||g|gd       y )Nr   )r
   r   r   r   r   r   r   r   r   r   r   r   r   r      r   r;   test_slice_default_axesr   r   )r(   r
   r   r   r   s        r)   export_slice_default_axeszSlice.export_slice_default_axesc   s    {{$$*E % 
 IIOOBA&--bjj9)2884xx2884aAaCiL!VT*QC>W	
r+   c                    t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  g dt        j                  	      }t        j                  g d
t        j                  	      }t        j                  g dt        j                  	      }|d d d d ddf   }t        | ||||g|gd       y )Nr   r
   r   r   r   r   r   r   r   r   r9   r   r:   r   r      r   r;   test_slice_default_stepsr   r   r(   r
   r   r   r   r   s         r)   export_slice_default_stepsz Slice.export_slice_default_stepst   s    {{$$2E % 
 IIOOBA&--bjj9)2884xx2884xx	2aAaCiLvtT*C+		
r+   c                 h   t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  g dt        j                  	      }t        j                  g d
t        j                  	      }t        j                  g dt        j                  	      }t        j                  g d      j                  t        j                        }|dddddddddf   }t        | |||||g|gd       y )Nr   r	   r   r   r   r   r   r:   r   )r   r   r   r@   )r-   r   r-   rF   r;   r   rG   test_slice_neg_stepsr   r   r/   s          r)   export_slice_neg_stepszSlice.export_slice_neg_steps   s    {{$$;E % 
 IIOOBA&--bjj9+RXX6xx	2xx	2&--bhh7b2gr!Bw!B&'vtT51C'		
r+   c                    t         j                  j                  dg ddg      } t        j                  j                  ddd      j                  t        j                        }t        j                  g dt        j                  	      }t        j                  g d
t        j                  	      }t        j                  g dt        j                  	      }|d d d d ddf   }t        | ||||g|gd       y )Nr   r?   r   r   r   r   r   r9   r   r:   )r   rG   r-   r   r;   test_slice_negative_axesr   r   rC   s         r)   export_slice_negative_axesz Slice.export_slice_negative_axes   s    {{$$2E % 
 IIOOBA&--bjj9)2884xx2884xx2884aAaCiLvtT*C+		
r+   N)returnNone)__name__
__module____qualname__staticmethodr*   r0   r4   r7   r=   rD   rI   rL    r+   r)   r   r      s    
 
$ 
 
* 
 
* 
 
* 
 
  
 
( 
 
* 
 
r+   r   )

__future__r   numpyr!   r   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   rS   r+   r)   <module>rX      s$    #   , .e
D e
r+   