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 of the input tensor 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 as input x.

Constraints

When the ATC tool is used, the --precision_mode parameter must be set to allow_fp32_to_fp16.

ONNX Opset Support

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