
    bIgc
                    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	dZ	 G d de      Z
y)
    )annotationsN)Base)expectc                    t        j                  | |      }t        j                  |       }t        j                  |t        j                  ||      d|       |S )Naxis   )npargmax
zeros_likeput_along_axisexpand_dims)xr   x_argmaxys       `/var/www/html/answerous/venv/lib/python3.12/site-packages/onnx/backend/test/case/node/hardmax.pyhardmaxr      sD    yy&H
aAat<adKH    c                  0    e Zd Zedd       Zedd       Zy)Hardmaxc                    t         j                  j                  ddgdg      } t        j                  g dg dg dg dg      j                  t        j                        }t        |      }t        | |g|gd	
       t        j                  g dg      j                  t        j                        }t        |      }t        | |g|gd
       y )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 % 
 HHlL,MNUUJJ
 AJtQC!3IJ HHl^$++BJJ7 AJtQC!3IJr   c                    t         j                  j                  ddd      j                  t         j                        } t
        j                  j                  ddgdgd      }t        | d	      }t        || g|gd
       t
        j                  j                  ddgdgd      }t        | d	      }t        || g|gd       t
        j                  j                  ddgdgd      }t        | d	      }t        || g|gd       t
        j                  j                  ddgdgd      }t        | d	      }t        || g|gd       t
        j                  j                  ddgdg      }t        || g|gd       y )Nr      r   r   r   r   r   )r   r   r   r   test_hardmax_axis_0r   r	   test_hardmax_axis_1r   test_hardmax_axis_2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   IIOOAq!$++BJJ7{{$$5E	 % 
 AAtQC!3HI{{$$5E	 % 
 AAtQC!3HI{{$$5E	 % 
 AAtQC!3HI{{$$5E	 % 
 ABtQC!3OP {{$$5E % 

 	tQC!3NOr   N)returnNone)__name__
__module____qualname__staticmethodr)   r4    r   r   r   r      s,    K K2 ,P ,Pr   r   )r/   )r   
np.ndarrayr   intr5   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d HPr   