
    h	                     j    S SK JrJr  S SKrS SKrS SKJr  S SKJ	r	  S\\   S\4S jr
 " S S	\5      rg)
    )AnyOptionalN)Base)expectoptionalreturnc                     U c   eU $ )N )r   s    h/var/www/fran/franai/venv/lib/python3.13/site-packages/onnx/backend/test/case/node/optionalgetelement.py-optional_get_element_reference_implementationr      s    O    c                   <    \ rS rSr\SS j5       r\SS j5       rSrg)OptionalHasElement   Nc                     [         R                  " / SQ5      R                  [         R                  5      n [        R
                  R                  [        R                  R                  S/S9n[        R
                  R                  U5      n[        R
                  R                  SS/S/S9n[        U 5      n[        UU /U/U/SS	9  [        UU /U/U/S
S	9  g )N            r   	elem_typeshapeOptionalGetElementoptional_inputoutputinputsoutputs)test_optional_get_element_optional_tensorr   r   input_type_protosname test_optional_get_element_tensor)nparrayastypefloat32onnxhelpermake_tensor_type_protoTensorProtoFLOATmake_optional_type_proto	make_noder   r   )r   tensor_type_protooptional_type_protonoder   s        r   export_get_element_tensor,OptionalHasElement.export_get_element_tensor   s    88L)00< KK>>&&,, ? 
 #kkBBCTU{{$$ *:);hZ % 
 ?xH:H23<	
 	:H013	
r   c                     [         R                  " / SQ5      R                  [         R                  5      /n [        R
                  R                  [        R                  R                  S/S9n[        R
                  R                  U5      n[        R
                  R                  U5      n[        R
                  R                  SS/S/S9n[        U 5      n[        UU /U/U/SS	9  [        UU /U/U/S
S	9  g )Nr   r   r   r   r   r   r   +test_optional_get_element_optional_sequencer!   "test_optional_get_element_sequence)r%   r&   r'   int32r)   r*   r+   r,   INT32make_sequence_type_protor.   r/   r   r   )r   r0   seq_type_protor1   r2   r   s         r   export_get_element_sequence.OptionalHasElement.export_get_element_sequence2   s    HH\*11"((;< KK>>&&,, ? 
 ==>OP"kkBB>R{{$$ *:);hZ % 
 ?xH:H23>	
 	:H-.5	
r   r
   )r   N)__name__
__module____qualname____firstlineno__staticmethodr3   r<   __static_attributes__r
   r   r   r   r      s(    
 
: 
 
r   r   )typingr   r   numpyr%   r)   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r   r
   r   r   <module>rH      s9   
 !   , .HSM c 
<
 <
r   