Group Operations

group ov_ops_cpp_api

OpenVINO C++ API to create operations from different opsets. Such API is used to creation models from code, write transformations and traverse the model graph

class AUGRUCell : public ov::op::util::RNNCellBase
#include <augru_cell.hpp>

AUGRUCell operation.

Public Functions

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.

class AUGRUSequence : public ov::op::util::RNNCellBase
#include <augru_sequence.hpp>

AUGRUSequence operation.

Public Functions

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.

class RPE : public ov::op::Op
#include <rotary_positional_embeddings.hpp>

Rotary Positional Embeddings operation Internal operation which may change in the future.

Public Functions

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.

class Abs : public ov::op::util::UnaryElementwiseArithmetic
#include <abs.hpp>

Elementwise absolute value operation.

Public Functions

Abs() = default

Constructs an absolute value operation.

Abs(const Output<Node> &arg)

Constructs an absolute value operation.

Output [d1, ...]

Parameters

argOutput that produces the input tensor.[d1, ...]

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Acos : public ov::op::util::UnaryElementwiseArithmetic
#include <acos.hpp>

Elementwise inverse cosine (arccos) operation.

Public Functions

Acos() = default

Constructs an arccos operation.

Acos(const Output<Node> &arg)

Constructs an arccos operation.

Output [d1, ...]

Parameters

argOutput that produces the input tensor.[d1, ...]

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Acosh : public ov::op::util::UnaryElementwiseArithmetic
#include <acosh.hpp>

Elementwise inverse hyperbolic cos operation.

Public Functions

Acosh() = default

Constructs an Acosh operation.

Acosh(const Output<Node> &arg)

Constructs an Acosh operation.

Output [d1, ...]

Parameters

argOutput that produces the input tensor.[d1, ...]

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class AdaptiveAvgPool : public ov::op::Op
#include <adaptive_avg_pool.hpp>

Adaptive average pooling operation.

Public Functions

AdaptiveAvgPool(const Output<Node> &data, const Output<Node> &output_shape)

Constructs adaptive average pooling operation.

Parameters
  • dataInput data

  • output_shape – 1D tensor describing output shape for spatial dimensions.

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.

class AdaptiveMaxPool : public ov::op::Op
#include <adaptive_max_pool.hpp>

Adaptive max pooling operation.

Public Functions

AdaptiveMaxPool(const Output<Node> &data, const Output<Node> &output_shape, const ov::element::Type &index_element_type = ov::element::i64)

Constructs adaptive max pooling operation.

Parameters
  • dataInput data

  • output_shape – 1D tensor describing output shape for spatial dimensions.

  • index_element_type – Specifies the output tensor type for indices output

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.

class Add : public ov::op::util::BinaryElementwiseArithmetic
#include <add.hpp>

Elementwise addition operation.

Public Functions

inline Add()

Constructs an uninitialized addition operation.

Add(const Output<Node> &arg0, const Output<Node> &arg1, const AutoBroadcastSpec &auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY))

Constructs an addition operation.

Output [d0, ...]

Parameters
  • arg0Output that produces the first input tensor.[d0, ...]

  • arg1Output that produces the second input tensor.[d0, ...]

  • auto_broadcast – Auto broadcast specification. Default is Numpy-style implicit broadcasting.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Asin : public ov::op::util::UnaryElementwiseArithmetic
#include <asin.hpp>

Elementwise inverse sine (arcsin) operation.

Public Functions

Asin() = default

Constructs an arcsin operation.

Asin(const Output<Node> &arg)

Constructs an arcsin operation.

Output [d1, ...]

Parameters

argOutput that produces the input tensor.[d1, ...]

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Assign : public ov::op::util::AssignBase
#include <assign.hpp>

Assign operation sets an input value to the variable with variable_id

Public Functions

Assign(const Output<Node> &new_value, const std::string &variable_id)

Constructs an Assign operation.

Parameters
  • new_valueNode that produces the input tensor.

  • variable_id – identifier of the variable to be updated.

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 virtual std::string get_variable_id() const override

Returns the identifier of corresponding variable.

class Assign : public ov::op::util::AssignBase
#include <assign.hpp>

Assign operation sets an input value to the variable with variable_id

Public Functions

Assign(const Output<Node> &new_value, const std::shared_ptr<util::Variable> &variable)

Constructs an Assign operation.

Parameters
  • new_valueNode that produces the input tensor.

  • variable – Class for storing and synchronizing element types, shapes and identifiers between pairs of Assign/ReadValue nodes.

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 virtual std::string get_variable_id() const override

Returns the identifier of corresponding variable.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Atan : public ov::op::util::UnaryElementwiseArithmetic
#include <atan.hpp>

Elementwise inverse tangent (arctan) operation.

Public Functions

Atan() = default

Constructs an arctan operation.

Atan(const Output<Node> &arg)

Constructs an arctan operation.

Output [d1, ...]

Parameters

argOutput that produces the input tensor.[d1, ...]

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Atanh : public ov::op::util::UnaryElementwiseArithmetic
#include <atanh.hpp>

Elementwise inverse hyperbolic tangent operation.

Public Functions

Atanh() = default

Constructs an Atanh operation.

Atanh(const Output<Node> &arg)

Constructs an Atanh operation.

Output [d1, ...]

Parameters

argOutput that produces the input tensor.[d1, ...]

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class BatchNormInference : public ov::op::Op
#include <batch_norm.hpp>

BatchNormInference operation.

Public Functions

BatchNormInference(const Output<Node> &input, const Output<Node> &gamma, const Output<Node> &beta, const Output<Node> &mean, const Output<Node> &variance, double epsilon)
Parameters
  • input – [., C, …]

  • gamma – gamma scaling for normalized value. [C]

  • beta – bias added to the scaled normalized value [C]

  • mean – value for mean normalization [C]

  • variance – value for variance normalization [C]

  • epsilon – Avoids divsion by 0 if input has 0 variance

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.

class BatchNormInference : public ov::op::Op
#include <batch_norm.hpp>

BatchNormInference operation.

Public Functions

BatchNormInference(const Output<Node> &input, const Output<Node> &gamma, const Output<Node> &beta, const Output<Node> &mean, const Output<Node> &variance, double epsilon)
Parameters
  • input – [., C, …]

  • gamma – gamma scaling for normalized value. [C]

  • beta – bias added to the scaled normalized value [C]

  • mean – value for mean normalization [C]

  • variance – value for variance normalization [C]

  • epsilon – Avoids divsion by 0 if input has 0 variance

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.

class BatchToSpace : public ov::op::Op
#include <batch_to_space.hpp>

BatchToSpace permutes data from the batch dimension of the data tensor into spatial dimensions.

Note

Values from the batch dimension are moved in spatial blocks dimensions.

   Output node produces a tensor with shape:
   `[batch / (block_shape[0] * block_shape[1] * ... * block_shape[N - 1]),
    D_1 * block_shape[1] - crops_begin[1] - crops_end[1],
    D_2 * block_shape[2] - crops_begin[2] - crops_end[2], ...,
    D_{N - 1} * block_shape[N - 1] - crops_begin[N - 1] - crops_end[N - 1]`
    of the same type as `data` input.

Public Functions

BatchToSpace(const Output<Node> &data, const Output<Node> &block_shape, const Output<Node> &crops_begin, const Output<Node> &crops_end)

Constructs a BatchToSpace operation.

Parameters
  • dataNode producing the data tensor

  • block_shape – The sizes of the block of values to be moved

  • crops_begin – Specifies the amount to crop from the beginning along each axis of data input

  • crops_end – Specifies the amount to crop from the ending along each axis of data input.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

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.

class BinaryConvolution : public ov::op::util::ConvolutionFwdPropBase
#include <binary_convolution.hpp>

BinaryConvolution operation.

Public Functions

BinaryConvolution() = default

Constructs a binary convolution operation.

BinaryConvolution(const Output<Node> &data, const Output<Node> &kernel, const Strides &strides, const CoordinateDiff &pads_begin, const CoordinateDiff &pads_end, const Strides &dilations, BinaryConvolutionMode mode, float pad_value, const PadType &auto_pad = PadType::EXPLICIT)

Constructs a binary convolution operation.

Output [N, C_OUT, R1, ... Rf]

Parameters
  • data – The node producing the input data batch tensor.

  • kernel – The node producing the filters tensor.

  • strides – The strides.

  • pads_begin – The beginning of padding shape.

  • pads_end – The end of padding shape.

  • dilations – The dilations.

  • mode – Defines how input tensor 0/1 values and weights 0/1 are interpreted.

  • pad_value – Floating-point value used to fill pad area.

  • auto_pad – The pad type for automatically computing padding sizes.

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 BinaryConvolutionMode &get_mode() const
Returns

The mode of convolution.

inline float get_pad_value() const
Returns

The pad value.

class BitwiseAnd : public ov::op::util::BinaryElementwiseBitwise
#include <bitwise_and.hpp>

Elementwise bitwise AND operation.

Public Functions

BitwiseAnd() = default

Constructs a bitwise AND operation.

BitwiseAnd(const Output<Node> &arg0, const Output<Node> &arg1, const AutoBroadcastSpec &auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY))

Constructs a bitwise AND operation.

Output [d0, ...]

Parameters
  • arg0Output that produces the first input tensor.[d0, ...]

  • arg1Output that produces the second input tensor.[d0, ...]

  • auto_broadcast – Auto broadcast specification. Default is Numpy-style implicit broadcasting.

class BitwiseNot : public ov::op::Op
#include <bitwise_not.hpp>

Elementwise bitwise negation operation.

Public Functions

BitwiseNot() = default

Constructs a bitwise negation operation.

BitwiseNot(const Output<Node> &arg)

Constructs a bitwise negation operation.

Parameters

argNode that produces the input tensor.

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.

class BitwiseOr : public ov::op::util::BinaryElementwiseBitwise
#include <bitwise_or.hpp>

Elementwise bitwise OR operation.

Public Functions

BitwiseOr() = default

Constructs a bitwise OR operation.

BitwiseOr(const Output<Node> &arg0, const Output<Node> &arg1, const AutoBroadcastSpec &auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY))

Constructs a bitwise OR operation.

Output [d0, ...]

Parameters
  • arg0Output that produces the first input tensor.[d0, ...]

  • arg1Output that produces the second input tensor.[d0, ...]

  • auto_broadcast – Auto broadcast specification. Default is Numpy-style implicit broadcasting.

class BitwiseXor : public ov::op::util::BinaryElementwiseBitwise
#include <bitwise_xor.hpp>

Elementwise bitwise XOR operation.

Public Functions

BitwiseXor() = default

Constructs a bitwise XOR operation.

BitwiseXor(const Output<Node> &arg0, const Output<Node> &arg1, const AutoBroadcastSpec &auto_broadcast = AutoBroadcastSpec(AutoBroadcastType::NUMPY))

Constructs a bitwise XOR operation.

Output [d0, ...]

Parameters
  • arg0Output that produces the first input tensor.[d0, ...]

  • arg1Output that produces the second input tensor.[d0, ...]

  • auto_broadcast – Auto broadcast specification. Default is Numpy-style implicit broadcasting.

class Broadcast : public ov::op::util::BroadcastBase
#include <broadcast.hpp>

Operation which “adds” axes to an input tensor, replicating elements from the input as needed along the new axes.

Public Functions

Broadcast() = default

Constructs a broadcast operation.

Broadcast(const Output<Node> &arg, const Output<Node> &target_shape, const Output<Node> &axes_mapping, const BroadcastModeSpec &broadcast_spec = BroadcastType::EXPLICIT)

Constructs a broadcast operation.

Parameters
  • arg – The input tensor to be broadcast.

  • target_shape – The shape of the output tensor.

  • axes_mapping – The axis positions (0-based) in the result that correspond to input axes. ‘Arg’ tensor is broadcast along the remaining axes. E.g., Input Shape - [3, 4], Target Shape - [3, 5, 4, 4] axes_mapping - [0, 2] => Broadcast along axes 1 and 3. axes_mapping - [0, 3] => Broadcast along axes 1 and 2.

  • broadcast_specBroadcast specification to use for determining broadcast axes. ‘axes_mapping’ should not be provided if mode other than explicit (none) is used.

Broadcast(const Output<Node> &arg, const Output<Node> &target_shape, const BroadcastModeSpec &broadcast_spec = BroadcastType::NUMPY)

Constructs a broadcast operation.

Parameters
  • arg – The input tensor to be broadcast.

  • target_shape – The shape of the output tensor.

  • broadcast_specBroadcast specification to use for determining broadcast axes

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.

virtual std::pair<bool, AxisSet> get_broadcast_axes() const override
Returns

true and the AxisSet if broadcast axes can be fully determined.

virtual bool evaluate(ov::TensorVector &outputs, const ov::TensorVector &inputs) const override

Evaluates the op on input_values putting results in output_values.

Parameters
  • output_values – Tensors for the outputs to compute. One for each result

  • input_values – Tensors for the inputs. One for each inputs.

Returns

true if successful

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Broadcast : public ov::op::util::BroadcastBase
#include <broadcast.hpp>

Operation which “adds” axes to an input tensor, replicating elements from the input as needed along the new axes.

Public Functions

Broadcast() = default

Constructs a broadcast operation.

Broadcast(const Output<Node> &arg, const Output<Node> &target_shape, const Output<Node> &axes_mapping, const AutoBroadcastSpec &broadcast_spec = AutoBroadcastSpec())

Constructs a broadcast operation.

Parameters
  • arg – The input tensor to be broadcast.

  • target_shape – The shape of the output tensor.

  • axes_mapping – The axis positions (0-based) in the result that correspond to input axes. ‘Arg’ tensor is broadcast along the remaining axes. E.g., Input Shape - [3, 4], Target Shape - [3, 5, 4, 4] axes_mapping - [0, 2] => Broadcast along axes 1 and 3. axes_mapping - [0, 3] => Broadcast along axes 1 and 2.

  • broadcast_specBroadcast specification to use for determining broadcast axes. ‘axes_mapping’ is ignored if broadcast_spec is not NONE

Broadcast(const Output<Node> &arg, const Output<Node> &target_shape, const AutoBroadcastSpec &broadcast_spec = AutoBroadcastSpec(AutoBroadcastType::NUMPY))

Constructs a broadcast operation.

Parameters
  • arg – The input tensor to be broadcast.

  • target_shape – The shape of the output tensor.

  • broadcast_specBroadcast specification to use for determining broadcast axes

inline const AutoBroadcastSpec &get_broadcast_spec() const
Returns

Broadcast Specification.

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.

virtual bool evaluate(ov::TensorVector &outputs, const ov::TensorVector &inputs) const override

Evaluates the op on input_values putting results in output_values.

Parameters
  • output_values – Tensors for the outputs to compute. One for each result

  • input_values – Tensors for the inputs. One for each inputs.

Returns

true if successful

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Bucketize : public ov::op::Op
#include <bucketize.hpp>

Operation that bucketizes the input based on boundaries.

Public Functions

Bucketize(const Output<Node> &data, const Output<Node> &buckets, const element::Type output_type = element::i64, const bool with_right_bound = true)

Constructs a Bucketize node.

Parameters
  • dataInput data to bucketize

  • buckets – 1-D of sorted unique boundaries for buckets

  • output_typeOutput tensor type, “i64” or “i32”, defaults to i64

  • with_right_bound – indicates whether bucket includes the right or left edge of interval. default true = includes right edge

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.

class Ceiling : public ov::op::util::UnaryElementwiseArithmetic
#include <ceiling.hpp>

Elementwise ceiling operation.

Public Functions

Ceiling() = default

Constructs a ceiling operation.

Ceiling(const Output<Node> &arg)

Constructs a ceiling operation.

Parameters

argNode that produces the input tensor.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Clamp : public ov::op::util::UnaryElementwiseArithmetic
#include <clamp.hpp>

Performs a clipping operation on all elements of the input node.

All input values that are outside of the <min;max> range are set to ‘min’ or ‘max’ depending on which side of the <min;max> range they are. The values that fall into this range remain unchanged.

Public Functions

Clamp(const Output<Node> &data, const double min, const double max)

Constructs a Clamp node.

Parameters
  • data – - Node producing the input tensor

  • min – - the lower bound of the <min;max> range

  • max – - the upper bound of the <min;max> range

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.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Concat : public ov::op::Op
#include <concat.hpp>

Concatenation operation.

Public Functions

Concat() = default

Constructs a concatenation operation.

Concat(const OutputVector &args, int64_t axis)

Constructs a concatenation operation.

Parameters
  • args – The outputs producing the input tensors.

  • axis – The axis along which to concatenate the input tensors.

Concat(const NodeVector &args, int64_t axis)

Constructs a concatenation operation.

Parameters
  • args – The nodes producing the input tensors.

  • axis – The axis along which to concatenate the input tensors.

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 int64_t get_concatenation_axis() const
Returns

The concatenation axis.

inline int64_t get_axis() const
Returns

The concatenation axis.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Constant : public ov::op::Op
#include <constant.hpp>

Class for constants.

Public Functions

OPENVINO_SUPPRESS_DEPRECATED_START Constant(const std::shared_ptr<ngraph::runtime::Tensor> &tensor)

Initialize a constant from tensor.

Parameters

tensor – The tensor with data

template<typename T>
inline Constant(const element::Type &type, const Shape &shape, std::shared_ptr<ngraph::runtime::SharedBuffer<T>> data)

Constructs a tensor constant with the supplied data.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • data – A pointer to pre-allocated shared data.

OPENVINO_SUPPRESS_DEPRECATED_END Constant(const ov::Tensor &tensor)

Initialize a constant from ov::Tensor.

Parameters

tensor – The ov::Tensor with data

template<typename T>
inline Constant(const element::Type &type, const Shape &shape, const std::vector<T> &values)

Constructs a tensor constant.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • values – A vector of literals for initializing the tensor constant. The size of values must match the size of the shape.

Constant(const element::Type &type, const Shape &shape)

Create uninitialized constant.

template<class T, class = typename std::enable_if<std::is_fundamental<T>::value>::type>
inline Constant(const element::Type &type, const Shape &shape, T value)

Constructs a uniform tensor constant.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • value – A scalar for initializing the uniform tensor constant. The value is broadcast to the specified shape.

Constant(const element::Type &type, const Shape &shape, const std::vector<std::string> &values)

Constructs a tensor constant This constructor is mainly to support deserialization of constants.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • values – A list of string values to use as the constant data.

Constant(const element::Type &type, const Shape &shape, const void *data)

Constructs a tensor constant with the supplied data.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • data – A void* to constant data.

inline 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.

virtual bool evaluate(ov::TensorVector &outputs, const ov::TensorVector &inputs) const override

Evaluates the op on input_values putting results in output_values.

Parameters
  • output_values – Tensors for the outputs to compute. One for each result

  • input_values – Tensors for the inputs. One for each inputs.

Returns

true if successful

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

Shape get_shape_val() const

Returns the value of the constant node as a Shape object Can only be used on element::i64 nodes and interprets negative values as zeros.

Strides get_strides_val() const

Returns the value of the constant node as a Strides object Can only be used on element::i64 nodes and interprets negative values as zeros.

Coordinate get_coordinate_val() const

Returns the value of the constant node as a Coordinate object Can only be used on element::i64 nodes and interprets negative values as zeros.

CoordinateDiff get_coordinate_diff_val() const

Returns the value of the constant node as a CoordinateDiff object Can only be used on element::i64 nodes.

AxisVector get_axis_vector_val() const

Returns the value of the constant node as an AxisVector object Can only be used on element::i64 nodes and interprets negative values as zeros.

AxisSet get_axis_set_val() const

Returns the value of the constant node as an AxisSet object Can only be used on element::i64 nodes and interprets negative values as zeros. Repeated values are allowed.

size_t get_byte_size() const

Return data size in bytes.

std::vector<std::string> get_value_strings() const
Returns

The initialization literals for the tensor constant.

template<typename T>
inline std::vector<T> cast_vector(int64_t num_elements = -1) const

Return the Constant’s value as a vector cast to type T.

Template Parameters

T – Type to which data vector’s entries will be cast.

Parameters

num_elements – (Optional) Number of elements to cast. In default case returns all elements

Returns

Constant’s data vector.

Public Static Functions

template<typename T>
static inline std::shared_ptr<Constant> create(const element::Type &type, const Shape &shape, const std::vector<T> &values)

Wrapper around constructing a shared_ptr of a Constant.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • values – A vector of values to use as the constant data.

template<typename T>
static inline std::shared_ptr<Constant> create(const element::Type &type, const Shape &shape, std::initializer_list<T> values)

Wrapper around constructing a shared_ptr of a Constant.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • values – An initializer_list of values to use as the constant data.

static inline std::shared_ptr<Constant> create(const element::Type &type, const Shape &shape, const void *memory)

Wrapper around constructing a shared_ptr of a Constant.

Parameters
  • type – The element type of the tensor constant.

  • shape – The shape of the tensor constant.

  • memory – An continues memory chunk which contains the constant data.

class Convert : public ov::op::Op
#include <convert.hpp>

Elementwise type conversion operation.

Public Functions

Convert() = default

Constructs a conversion operation.

Convert(const Output<Node> &arg, const ov::element::Type &destination_type)

Constructs a conversion operation.

Parameters
  • argNode that produces the input tensor.

  • destination_type – Element type for the output tensor.

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.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class ConvertLike : public ov::op::Op
#include <convert_like.hpp>

Elementwise type conversion operation.

Public Functions

ConvertLike() = default

Constructs a conversion operation.

ConvertLike(const Output<Node> &data, const Output<Node> &like)

Constructs a conversion operation.

Parameters
  • dataNode that produces the input tensor.

  • likeNode which provides the target type information for the conversion.

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.

class Convolution : public ov::op::util::ConvolutionFwdPropBase
#include <convolution.hpp>

Batched convolution operation, with optional window dilation and stride.

Public Functions

Convolution() = default

Constructs a batched convolution operation.

Convolution(const Output<Node> &data_batch, const Output<Node> &filters, const Strides &strides, const CoordinateDiff &pads_begin, const CoordinateDiff &pads_end, const Strides &dilations, const PadType &auto_pad = PadType::EXPLICIT)

Constructs a batched convolution operation.

Output [N, C_OUT, R1, ... Rf]

Parameters
  • data_batch – The node producing the input data batch tensor.[N, C_IN, D1, ... Df]

  • filters – The node producing the filters tensor.[C_OUT, C_IN, F1, ... Ff]

  • strides – The strides.[f]

  • dilations – The dilations.[f]

  • pads_begin – The beginning of padding shape.[f]

  • pads_end – The end of padding shape.[f]

  • auto_pad – The pad type for automatically computing padding sizes.[f]

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.

class ConvolutionBackpropData : public ov::op::util::ConvolutionBackPropBase
#include <convolution.hpp>

Data batch backprop for batched convolution operation.

Public Functions

ConvolutionBackpropData() = default

Constructs a batched-convolution data batch-backprop operation.

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.

const PartialShape get_output_shape() const
Returns

The output spatial dimensions shape.

void infer_conv_backprop_output_spatial_shape(const std::vector<Dimension> &input_data_shape, const std::vector<Dimension> &filters_shape, const Strides &strides, const Strides &dilations, const CoordinateDiff &pads_begin, const CoordinateDiff &pads_end, const CoordinateDiff &output_padding, std::vector<Dimension> &output_spatial_shape)

Calculates output spatial features size.

Parameters
  • input_data_shape[in] The input data partial shape

  • filters_shape[in] The filters partial shape

  • strides[in] The strides values.

  • dilations[in] The dilations values.

  • pads_begin[in] The paddings at the beginning of axis.

  • pads_end[in] The paddings at the end of axis.

  • output_padding[in] The output padding values.

  • output_spatial_shape – The placeholder for computed output spatial partial shape.

class Cos : public ov::op::util::UnaryElementwiseArithmetic
#include <cos.hpp>

Elementwise cosine operation.

Public Functions

Cos() = default

Constructs a cosine operation.

Cos(const Output<Node> &arg)

Constructs a cosine operation.

Parameters

argNode that produces the input tensor.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class Cosh : public ov::op::util::UnaryElementwiseArithmetic
#include <cosh.hpp>

Elementwise hyperbolic cosine (cosh) operation.

Public Functions

Cosh() = default

Constructs a hyperbolic cosine operation.

Cosh(const Output<Node> &arg)

Constructs a hyperbolic cosine operation.

Parameters

argNode that produces the input tensor.

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

class CTCGreedyDecoder : public ov::op::Op
#include <ctc_greedy_decoder.hpp>

CTCGreedyDecoder operation.

Public Functions

CTCGreedyDecoder(const Output<Node> &input, const Output<Node> &seq_len, const bool ctc_merge_repeated)

Constructs a CTCGreedyDecoder operation.

Parameters
  • input – Logits on which greedy decoding is performed

  • seq_len – Sequence lengths

  • ctc_merge_repeated – Whether to merge repeated labels

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.

class CTCGreedyDecoderSeqLen : public ov::op::Op
#include <ctc_greedy_decoder_seq_len.hpp>

Operator performing CTCGreedyDecoder.

Public Functions

CTCGreedyDecoderSeqLen(const Output<Node> &input, const Output<Node> &seq_len, const bool merge_repeated = true, const element::Type &classes_index_type = element::i32, const element::Type &sequence_length_type = element::i32)

Constructs a CTCGreedyDecoderSeqLen operation.

Parameters
  • input – 3-D tensor of logits on which greedy decoding is performed

  • seq_len – 1-D tensor of sequence lengths

  • merge_repeated – Whether to merge repeated labels

  • classes_index_type – Specifies the output classes_index tensor type

  • sequence_length_type – Specifies the output sequence_length tensor type

CTCGreedyDecoderSeqLen(const Output<Node> &input, const Output<Node> &seq_len, const Output<Node> &blank_index, const bool merge_repeated = true, const element::Type &classes_index_type = element::i32, const element::Type &sequence_length_type = element::i32)

Constructs a CTCGreedyDecoderSeqLen operation.

Parameters
  • input – 3-D tensor of logits on which greedy decoding is performed

  • seq_len – 1-D tensor of sequence lengths

  • blank_index – Scalar or 1-D tensor with 1 element used to mark a blank index

  • merge_repeated – Whether to merge repeated labels

  • classes_index_type – Specifies the output classes_index tensor type

  • sequence_length_type – Specifies the output sequence_length tensor type

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 bool get_merge_repeated() const

Get merge_repeated attribute.

Returns

Current value of merge_repeated attribute

inline void set_merge_repeated(bool merge_repeated)

Set merge_repeated attribute.

Parameters

merge_repeated – A new value for the attribute

inline const element::Type &get_classes_index_type() const

Get classes_index_type attribute.

Returns

Current value of classes_index_type attribute

inline void set_classes_index_type(const element::Type &classes_index_type)

Set classes_index_type attribute.

Parameters

classes_index_type – Type of classes_index

inline const element::Type &get_sequence_length_type() const

Get sequence_length_type attribute.

Returns

Current value of sequence_length_type attribute

inline void set_sequence_length_type(const element::Type &sequence_length_type)

Set sequence_length_type attribute.

Parameters

sequence_length_type – Type of sequence length

class CTCLoss : public ov::op::Op
#include <ctc_loss.hpp>

CTCLoss operation.

Public Functions

CTCLoss(const Output<Node> &logits, const Output<Node> &logit_length, const Output<Node> &labels, const Output<Node> &label_length, const bool preprocess_collapse_repeated = false, const bool ctc_merge_repeated = true, const bool unique = false)

Constructs a CTCLoss operation.

Parameters
  • logits – 3-D tensor of logits

  • logit_length – 1-D tensor of length for each object from a batch

  • labels – 2-D tensor of labels for which likelyhood is estimated using logist

  • label_length – 1-D tensor of length for each label sequence

  • blank_index – Scalar used to mark a blank index

  • preprocess_collapse_repeated – Flag for preprocessing labels before loss calculation

  • ctc_merge_repeated – Flag for merging repeated characters in a potential alignment

  • unique – Flag to find unique elements in a target before matching with alignment

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.

class CumSum : public ov::op::Op
#include <cum_sum.hpp>

Tensor cumulative sum operation.

Compute the cumulative sum of the input tensor along the axis specified.

Public Functions

CumSum() = default

Constructs a cumulative summation operation.

CumSum(const Output<Node> &arg, const Output<Node> &axis, const bool exclusive = false, const bool reverse = false)

Constructs a cumulative summation operation.

Parameters
  • arg – The tensor to be summed.

  • axis – zero dimension tensor specifying axis position along which cumulative sum must be performed

  • exclusive – if set to true, the top element is not included

  • reverse – if set to true, will perform the sums in reverse direction

CumSum(const Output<Node> &arg, const bool exclusive = false, const bool reverse = false)

Constructs a cumulative summation operation with axis = 0.

Parameters

arg – The tensor to be summed

virtual bool has_evaluate() const override

Allows to get information about availability of evaluate method for the current operation.

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.

class DeformableConvolution : public ov::op::util::DeformableConvolutionBase
#include <deformable_convolution.hpp>

DeformableConvolution operation.

Public Functions

DeformableConvolution() = default

Constructs a conversion operation.

DeformableConvolution(const Output<Node> &arg, const Output<Node> &offsets, const Output<Node> &filters, const Strides &strides, const CoordinateDiff &pads_begin, const CoordinateDiff &pads_end, const Strides &dilations, const PadType