Class ov::op::util::OneHotBase#

class OneHotBase : public ov::op::Op#

Subclassed by ov::op::v16::OneHot, ov::op::v1::OneHot

Public Functions

OneHotBase() = default#

Constructs a one-hot operation.

OneHotBase(const Output<Node> &indices, const Output<Node> &depth, const Output<Node> &on_value, const Output<Node> &off_value, int64_t axis)#

Constructs a one-hot operation.

Parameters:
  • indicesInput tensor containing indices.

  • depth – Specifies number of classes and the size of one-hot dimension.

  • on_value – Specifies value that the locations in output tensor represented by indices in input take.

  • off_value – Specifies value that the locations in output tensor not represented by indices in input take.

  • axis – Axis along which one-hot representation in added.

virtual void validate_and_infer_types() override#

Verifies that attributes and inputs are consistent and computes output shapes and element types. Must be implemented by concrete child classes so that it can be run any number of times.

Throws if the node is invalid.

inline const int64_t &get_axis() const#
Returns:

The index of the one-hot axis.

void set_axis(int64_t axis)#

Sets the index of the one-hot axis.

Parameters:

axis – The index of the one-hot axis.