OneHot
Description
Performs one_hot calculation on an input tensor whose length is n to obtain an output tensor whose size is n x k. The value of k is numClasses.

Input
- indices: input tensor of type int32.
- depth: input tensor of type int32.
- values: input tensor of type int32, float16, or float.
Attribute
axis (optional): int64, indicating the axis of the operator.
Output
y: output tensor of the identical data type as input indices.
Constraints
- axis must not be less than –1.
- The depth is greater than or equal to 1.
- When the output is of type int64, the range of the last input value is [0,1], where 1 indicates on_value and 0 indicates off_value.
ONNX Opset Support
Opset v9/v10/v11/v12/v13/v14/v15/v16/v17/v18.
Parent topic: Supported ONNX Operators