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 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 AvgPool : public ov::op::util::AvgPoolBase
#include <avg_pool.hpp>

Batched average pooling operation.

Public Functions

AvgPool() = default

Constructs a batched average pooling operation.

AvgPool(const Output<Node> &arg, const Strides &strides, const Shape &pads_begin, const Shape &pads_end, const Shape &kernel, bool exclude_pad, RoundingType rounding_type = RoundingType::FLOOR, const PadType &auto_pad = PadType::EXPLICIT)

Constructs a batched average pooling operation.

Parameters:
  • arg – The output producing the input data batch tensor.[d1, dn]

  • strides – The strides.[n]

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

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

  • kernel – The kernel shape.[n]

  • exclude_pad – If false then averages include padding elements, each treated as the number zero. If true, padding elements are entirely ignored when computing averages.

  • rounding_type – Whether to use ceiling or floor rounding type while computing output shape.

  • auto_pad – Padding type to use for additional padded 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 AvgPool : public ov::op::util::AvgPoolBase
#include <avg_pool.hpp>

Batched average pooling operation.

Public Functions

AvgPool() = default

Constructs a batched average pooling operation.

AvgPool(const Output<Node> &arg, const Strides &strides, const Shape &pads_begin, const Shape &pads_end, const Shape &kernel, bool exclude_pad, RoundingType rounding_type = RoundingType::FLOOR, const PadType &auto_pad = PadType::EXPLICIT)

Constructs a batched average pooling operation.

Parameters:
  • arg – The output producing the input data batch tensor.[d1, dn]

  • strides – The strides.[n]

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

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

  • kernel – The kernel shape.[n]

  • exclude_pad – If false then averages include padding elements, each treated as the number zero. If true, padding elements are entirely ignored when computing averages.

  • rounding_type – Whether to use ceiling or floor rounding type while computing output shape.

  • auto_pad – Padding type to use for additional padded 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 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 BitwiseLeftShift : public ov::op::util::BinaryElementwiseBitwise
#include <bitwise_left_shift.hpp>

Elementwise bitwise BitwiseLeftShift operation.

Public Functions

BitwiseLeftShift() = default

Constructs a bitwise BitwiseLeftShift operation.

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

Constructs a bitwise BitwiseLeftShift operation.

Output [d0, ...]

Parameters:
  • arg0Node with data to be shifted. [d0, ...]

  • arg1Node with number of shifts. [d0, ...]

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

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 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 BitwiseRightShift : public ov::op::util::BinaryElementwiseBitwise
#include <bitwise_right_shift.hpp>

Elementwise bitwise BitwiseRightShift operation.

Public Functions

BitwiseRightShift() = default

Constructs a bitwise BitwiseRightShift operation.

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

Constructs a bitwise BitwiseRightShift operation.

Output [d0, ...]

Parameters:
  • arg0Node with data to be shifted. [d0, ...]

  • arg1Node with number of shifts. [d0, ...]

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

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 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 Col2Im : public ov::op::Op
#include <col2im.hpp>

Operator combining sliding blocks into an image tensor.

Public Functions

Col2Im(const Output<Node> &data, const Output<Node> &output_size, const Output<Node> &kernel_size, const Strides &strides = Strides{1, 1}, const Strides &dilations = Strides{1, 1}, const Shape &pads_begin = Shape{0, 0}, const Shape &pads_end = Shape{0, 0})

Constructs a Col2Im operation.

Parameters:
  • dataInput tensor with data

  • output_sizeShape of the spatial dimensions of the output image

  • kernel_size – Size of the sliding blocks

  • strides – Stride in the sliding blocks in the input spatial dimensions

  • dilations – Local stride of the elements

  • pads_begin – Paddings at the beginning of each spatial axis, if undefined no padding is applied

  • pads_end – Paddings at the end of each spatial axis, if undefined no padding is applied

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

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.

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.

const Tensor get_tensor_view() const

Get view on constant data as tensor.

Returns:

OV::Tensor with constant data.

const Strides &get_strides() const
Returns:

Constant’s strides in bytes.

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 ConvertPromoteTypes : public ov::op::Op
#include <convert_promote_types.hpp>

Elementwise operation that promote and convert input types to one common datatype.

Public Functions

ConvertPromoteTypes() = default

Constructs operation that promote and convert input types to one common datatype.

ConvertPromoteTypes(const Output<Node> &input_0, const Output<Node> &input_1, const bool promote_unsafe = false, const bool pytorch_scalar_promotion = false, const element::Type &