Hardmax

Description

Finds the first maximum value along the specified axis, sets the position of the first maximum value in the axis to 1, and sets other positions to 0.

Input

x: input tensor. The dimension is greater than or equal to axis. The data type can be float16 or float.

Attribute

axis: int. The default value is -1. This parameter indicates the dimension along which Hardmax is executed.

Output

y: output tensor of the identical data type and shape to input x.

Constraints

In the atc command line, the precision_mode option must be set to allow_fp32_to_fp16.

ONNX Opset Support

Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18