namespace ov::op

Overview

namespace op {

// namespaces

namespace ov::op::ShapeInferRange;
namespace ov::op::convolution;
    namespace ov::op::convolution::validate;
namespace ov::op::deformable_conv;
    namespace ov::op::deformable_conv::validate;
namespace ov::op::detectron;
    namespace ov::op::detectron::validate;
namespace ov::op::eye;
namespace ov::op::gather_nd;
namespace ov::op::internal;
namespace ov::op::interpolate;
    namespace ov::op::interpolate::validate;
namespace ov::op::multiclass_nms;
    namespace ov::op::multiclass_nms::validate;
namespace ov::op::nms;
    namespace ov::op::nms::validate;
namespace ov::op::pooling;
    namespace ov::op::pooling::validate;
namespace ov::op::prior_box;
    namespace ov::op::prior_box::validate;
namespace ov::op::proposal;
namespace ov::op::psroi_pooling;
    namespace ov::op::psroi_pooling::validate;
namespace ov::op::rnn;
namespace ov::op::roi_align;
    namespace ov::op::roi_align::validate;
namespace ov::op::roi_pooling;
    namespace ov::op::roi_pooling::validate;
namespace ov::op::shape_of;
namespace ov::op::slice;
namespace ov::op::util;
    namespace ov::op::util::detail;
    namespace ov::op::util::embedding;
    namespace ov::op::util::error;
    namespace ov::op::util::rfft_common_validation;
namespace ov::op::v0;
    namespace ov::op::v0::lstm_cell;
namespace ov::op::v1;
namespace ov::op::v10;
namespace ov::op::v11;
namespace ov::op::v12;
namespace ov::op::v3;
namespace ov::op::v4;
    namespace ov::op::v4::ctc_loss;
    namespace ov::op::v4::lstm_cell;
namespace ov::op::v5;
namespace ov::op::v6;
namespace ov::op::v7;
namespace ov::op::v8;
namespace ov::op::v9;
namespace ov::op::validate;

// enums

enum AutoBroadcastType;
enum BroadcastType;
enum EpsMode;
enum GeluApproximationMode;
enum LSTMWeightsFormat;
enum MVNEpsMode;
enum PadMode;
enum PadType;
enum RecurrentSequenceDirection;
enum RoundingType;
enum TopKMode;
enum TopKSortType;

// structs

struct AutoBroadcastSpec;
struct BroadcastModeSpec;

// classes

class Op;
class Sink;
class TemporaryReplaceOutputType;
template <typename BaseOp>
class TypeRelaxed;
class TypeRelaxedBase;

// global functions

OPENVINO_SUPPRESS_DEPRECATED_END std::unordered_map<size_t, std::pair<ov::Tensor, ov::Tensor>> OPENVINO_API convert_input_types(
    OutputVector& inputs,
    const element::TypeVector& types
    );

ov::TensorVector OPENVINO_API get_output_tensors_of_original_type(
    const ov::TensorVector& fake_output_tensors,
    const element::TypeVector& types
    );

void OPENVINO_API reset_input_types(
    const std::unordered_map<size_t, std::pair<ov::Tensor, ov::Tensor>>& original_input_vals,
    OutputVector& inputs
    );

bool OPENVINO_API convert_outputs_to_fake_type(
    ov::TensorVector& outputs,
    ov::TensorVector& original_outputs,
    bool is_upper
    );

OPENVINO_API std::ostream& operator << (
    std::ostream& s,
    const GeluApproximationMode& type
    );

ov::op::util::LSTMWeightsFormat convert_lstm_weights_enums(LSTMWeightsFormat format);
OPENVINO_API std::ostream& operator << (std::ostream& s, const MVNEpsMode& type);

OPENVINO_API std::ostream& operator << (
    std::ostream& s,
    const v12::ScatterElementsUpdate::Reduction& reduction
    );

OPENVINO_API std::ostream& operator << (std::ostream& s, const PadMode& type);
OPENVINO_API std::ostream& operator << (std::ostream& s, const PadType& type);
OPENVINO_API std::ostream& operator << (std::ostream& s, const RoundingType& type);

OPENVINO_API std::ostream& operator << (
    std::ostream& s,
    const AutoBroadcastType& type
    );

OPENVINO_API std::ostream& operator << (
    std::ostream& s,
    const BroadcastType& type
    );

OPENVINO_API std::ostream& operator << (std::ostream& s, const EpsMode& type);
OPENVINO_API std::ostream& operator << (std::ostream& s, const TopKSortType& type);
OPENVINO_API std::ostream& operator << (std::ostream& s, const TopKMode& type);

OPENVINO_API std::ostream& operator << (
    std::ostream& s,
    const RecurrentSequenceDirection& direction
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> copy_shape_infer(
    const Node \* op,
    const std::vector<TShape>& input_shapes
    );

template <class OpType, class T, class TRShape = result_shape_t<T>>
std::vector<TRShape> eltwise_shape_infer(
    const OpType \* op,
    const std::vector<T>& input_shapes
    );

template <class T, class TRShape = result_shape_t<T>>
std::vector<TRShape> shape_infer(
    const util::FFTBase \* op,
    const std::vector<T>& input_shapes,
    const ITensorAccessor& ta = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::GatherBase \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::ConvertColorI420Base \* op,
    const std::vector<TShape>& input_shapes
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::MulticlassNmsBase \* op,
    const std::vector<TShape>& input_shapes,
    const bool static_output = !std::is_same<PartialShape, TShape>::value,
    const bool ignore_bg_class = false
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::ConvertColorNV12Base \* op,
    const std::vector<TShape>& input_shapes
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::PadBase \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> reduce_shape_infer(
    const util::ReductionBase \* op,
    bool keep_dims,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::ArithmeticReductionKeepDims \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::LogicalReductionKeepDims \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::ScatterElementsUpdateBase \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& ta = make_tensor_accessor()
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::ScatterNDBase \* op,
    const std::vector<TShape>& input_shapes
    );

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::TopKBase \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    );

template <
    class TShape,
    class TData,
    class TRes = std::vector<TData>,
    class UnaryOperation = ov::util::Cast<TData>,
    typename std::enable_if<!std::is_same<TShape, ov::PartialShape>::value>::type \* = nullptr
    >
std::unique_ptr<TRes> get_input_const_data_as(
    const ov::Node \* op,
    size_t idx,
    const ITensorAccessor& tensor_accessor,
    UnaryOperation&& func = ov::util::Cast<TData>()
    );

template <
    class TShape,
    class TDimValue = typename TShape::value_type::value_type,
    class UnaryOperation = ov::util::InTypeRange<TDimValue>,
    typename std::enable_if<!std::is_same<TShape, ov::PartialShape>::value>::type \* = nullptr
    >
ov::optional<TShape> get_input_const_data_as_shape(
    const ov::Node \* op,
    size_t port,
    const ITensorAccessor& tensor_accessor,
    UnaryOperation&& func = ov::util::InTypeRange<TDimValue>()
    );

element::Type get_input_const_element_type(
    const ov::Node \*const op,
    size_t port,
    const ITensorAccessor& ta
    );

template <
    class TShape,
    class TData,
    class TResult = std::vector<std::pair<TData, TData>>
    >
ov::optional<TResult> get_input_bounds(
    const ov::Node \* op,
    size_t port,
    const ITensorAccessor& ta
    );

} // namespace op

Detailed Documentation

Global Functions

template <class TShape, class TRShape = result_shape_t<TShape>>
std::vector<TRShape> shape_infer(
    const util::TopKBase \* op,
    const std::vector<TShape>& input_shapes,
    const ITensorAccessor& tensor_accessor = make_tensor_accessor()
    )

TopK shape inference.

Parameters:

TShape

Type of shape.

op

Pointer to TopK operator.

input_shapes

Input shapes of TopK.

constant_data

Map of constant data. DEfault empty.

Returns:

Vector of output shapes for

template <
    class TShape,
    class TData,
    class TRes = std::vector<TData>,
    class UnaryOperation = ov::util::Cast<TData>,
    typename std::enable_if<!std::is_same<TShape, ov::PartialShape>::value>::type \* = nullptr
    >
std::unique_ptr<TRes> get_input_const_data_as(
    const ov::Node \* op,
    size_t idx,
    const ITensorAccessor& tensor_accessor,
    UnaryOperation&& func = ov::util::Cast<TData>()
    )

Get the operator’s input const as pointer to vector of specified type.

The behaviour depends on shape type. The default output type is std::vector<TData> can be replace by other type which if is possible to construct it from constant data vector.

The behaviour depends on shape type. The default output type is std::vector<TData> can be replace by other type which if is possible to construct it from constant data vector.

Parameters:

TShape

Shape type which enabled this version (not ov::PartialShape)

TData

Type use to cast input’s data.

TRes

Result type which has got default type as std::vector<TData>.

UnaryOperation

Unary function object applied on data with signature (Ret f(const TData &a)).

op

Pointer to operator.

idx

Operator’s input number.

tensor_accessor

Tensor accessor object.

func

Unary operation function object.

TShape

Shape type which enabled this version (ov::PartialShape)

TData

Type use to cast input’s data.

TRes

Result type which has got default type as std::vector<TData>.

UnaryOperation

Unary function object applied on data with signature (Ret f(const TData &a)).

op

Pointer to operator.

idx

Operator’s input number.

tensor_accessor

Tensor accessor object.

func

Unary operation function object.

Returns:

Pointer to constant data or nullptr if input has no constant data.

Pointer to constant data or nullptr if input has no constant data.

template <
    class TShape,
    class TDimValue = typename TShape::value_type::value_type,
    class UnaryOperation = ov::util::InTypeRange<TDimValue>,
    typename std::enable_if<!std::is_same<TShape, ov::PartialShape>::value>::type \* = nullptr
    >
ov::optional<TShape> get_input_const_data_as_shape(
    const ov::Node \* op,
    size_t port,
    const ITensorAccessor& tensor_accessor,
    UnaryOperation&& func = ov::util::InTypeRange<TDimValue>()
    )

Get the input const data as shape object.

The input data can be processed by unary operation. By default is validated and casted to shape’s dimension type.

Parameters:

TShape

Shape type.

TDimValue

Dimension value type.

UnaryOperation

Unary function object applied on data with signature (Ret f(const TDimValue &a)).

op

Pointer to operator.

port

Input port number.

tensor_accessor

Tensor accessor object.

func

Unary operation function object to apply in input data. Default ov::utils::InTypeRange<TDimValue>.

Returns:

Unique pointer to shape created from input data.

template <
    class TShape,
    class TData,
    class TResult = std::vector<std::pair<TData, TData>>
    >
ov::optional<TResult> get_input_bounds(
    const ov::Node \* op,
    size_t port,
    const ITensorAccessor& ta
    )

Get the input bounds from constant input or try evaluate bunds and return them as vector of pairs (lower, upper).

Parameters:

TShape

Shape type.

TData

Bound value type.

op

Operator pointer.

port

Input port number.

ta

Tensor accessor to constant data.

Returns:

Return optional vector of bounds as pair lower, upper when evaluated successful.