openvino.runtime.opset16.one_hot#

openvino.runtime.opset16.one_hot(indices: Node | int | float | ndarray, depth: Node | int | float | ndarray, on_value: Node | int | float | ndarray, off_value: Node | int | float | ndarray, axis: int, negative_indices_mode: str | None = None, name: str | None = None) Node#

Create node performing one-hot encoding on input data.

Parameters:
  • indices – Input tensor of rank N with indices of any supported integer data type.

  • depth – Scalar of any supported integer type that specifies number of classes and the size of one-hot dimension.

  • on_value – Scalar of any type that is the value that the locations in output tensor represented by indices in input take.

  • off_value – Scalar of any type that is the value that the locations not represented by indices in input take.

  • axis – New axis position in the output shape to fill with one-hot values.

  • negative_indices_mode – Controls how negative indices are handled. Can be ‘ignore_negative’ (negative indices are ignored and filled with off_value) or ‘normalize’ (negative indices in range [-depth, -1] are normalized). If not provided, defaults to ‘ignore_negative’.

  • name – The optional name for new output node.

Returns:

New node performing one-hot operation.