ngraph.opset7.one_hot

ngraph.opset7.one_hot(indices: Union[_pyngraph.Node, int, float, numpy.ndarray], depth: Union[_pyngraph.Node, int, float, numpy.ndarray], on_value: Union[_pyngraph.Node, int, float, numpy.ndarray], off_value: Union[_pyngraph.Node, int, float, numpy.ndarray], axis: int, name: Optional[str] = None) _pyngraph.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.

  • name – The optional name for new output node.

Returns

New node performing one-hot operation.