Hardmax

Description

Computes the Hardmax result. If the element is the largest element of the specified axis, the value is 1. Otherwise, the value is 0.

Input

One input:

x: tensor of type float16 or float.

Output

One output:

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

Attribute

axis: int. Defaults to -1.

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