
    /jc
                    `    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
dS )    )annotationsN)Base)expectx
np.ndarrayaxisintreturnc                    t          j        | |          }t          j        |           }t          j        |t          j        ||          d|           |S )Nr	      )npargmax
zeros_likeput_along_axisexpand_dims)r   r	   x_argmaxys       h/home/longshao/multi-rider-rag/.venv/lib/python3.11/site-packages/onnx/backend/test/case/node/hardmax.pyhardmaxr      sS    y&&&H
aAat<<<adKKKKH    c                  >    e Zd Zedd            Zedd            ZdS )Hardmaxr   Nonec                    t           j                            ddgdg          } t          j        g dg dg dg dg                              t          j                  }t          |          }t          | |g|gd	
           t          j        g dg                              t          j                  }t          |          }t          | |g|gd
           d S )Nr   r   r   inputsoutputs)   r   r      )r!      r   r   )r   r   r    r!   )r   r   r!   r    test_hardmax_exampler   r   name)r    r    r    r   test_hardmax_one_hot)	onnxhelper	make_noder   arrayastypefloat32r   r   )noder   r   s      r   exportzHardmax.export   s    {$$5E % 
 
 HlllLLL,,,MNNUUJ
 
 AJJtQC!3IJJJJ Hlll^$$++BJ77 AJJtQC!3IJJJJJJr   c                 L   t           j                            ddd                              t           j                  } t
          j                            ddgdgd          }t          | d	          }t          || g|gd
           t
          j                            ddgdgd          }t          | d	          }t          || g|gd           t
          j                            ddgdgd          }t          | d	          }t          || g|gd           t
          j                            ddgdgd          }t          | d	          }t          || g|gd           t
          j                            ddgdg          }t          || g|gd           d S )Nr       r"   r   r   r   r   )r   r   r	   r   test_hardmax_axis_0r$   r   test_hardmax_axis_1r!   test_hardmax_axis_2r   test_hardmax_negative_axisr   test_hardmax_default_axis)
r   randomrandnr+   r,   r'   r(   r)   r   r   )r   r-   r   s      r   export_hardmax_axiszHardmax.export_hardmax_axis/   s   IOOAq!$$++BJ77{$$5E	 % 
 
 AAtQC!3HIIII{$$5E	 % 
 
 AAtQC!3HIIII{$$5E	 % 
 
 AAtQC!3HIIII{$$5E	 % 
 
 ABtQC!3OPPPP {$$5E % 
 

 	tQC!3NOOOOOOr   N)r   r   )__name__
__module____qualname__staticmethodr.   r8    r   r   r   r      s\        K K K \K2 ,P ,P ,P \,P ,P ,Pr   r   )r   )r   r   r	   r
   r   r   )
__future__r   numpyr   r'   onnx.backend.test.case.baser   onnx.backend.test.case.noder   r   r   r=   r   r   <module>rB      s    # " " " " "      , , , , , , . . . . . .    HP HP HP HP HPd HP HP HP HP HPr   