namespace ov::op

Overview

namespace op {

// namespaces

namespace ov::op::ShapeInferLSTM;
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::eye;
namespace ov::op::gather_nd;
namespace ov::op::internal;
namespace ov::op::pooling;
    namespace ov::op::pooling::validate;
namespace ov::op::psroi_pooling;
    namespace ov::op::psroi_pooling::validate;
namespace ov::op::rnn;
namespace ov::op::roi_pooling;
    namespace ov::op::roi_pooling::validate;
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::v1;
    namespace ov::op::v1::utils;
        namespace ov::op::v1::utils::one_hot;
namespace ov::op::v10;
namespace ov::op::v11;
namespace ov::op::v3;
namespace ov::op::v4;
    namespace ov::op::v4::ctc_loss;
namespace ov::op::v5;
namespace ov::op::v6;
namespace ov::op::v7;
namespace ov::op::v8;
namespace ov::op::v9;

// 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 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 OpType, class ShapeType>
void read_value_shape_infer(
    const OpType \* op,
    const std::vector<ShapeType>& input_shapes,
    std::vector<ShapeType>& output_shapes
    );

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

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

template <
    class TShape,
    class TData,
    class TRes = std::vector<TData>,
    class TTensorPtr = HostTensorPtr,
    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 std::map<size_t, TTensorPtr>& constant_data = {},
    UnaryOperation&& func = ov::util::Cast<TData>()
    );

template <
    class TShape,
    class TDimValue = typename TShape::value_type::value_type,
    class TTensorPtr = HostTensorPtr,
    class UnaryOperation = ov::util::InTypeRange<TDimValue>
    >
std::unique_ptr<TShape> get_input_const_data_as_shape(
    const ov::Node \* op,
    size_t idx,
    const std::map<size_t, TTensorPtr>& constant_data = {},
    UnaryOperation&& func = ov::util::InTypeRange<TDimValue>()
    );

template <
    class TShape,
    class TData,
    class TResult = std::vector<std::pair<TData, TData>>
    >
std::unique_ptr<TResult> get_input_bounds(
    const ov::Node \* op,
    size_t idx,
    const std::map<size_t, HostTensorPtr>& constant_data
    );

} // namespace op

Detailed Documentation

Global Functions

template <
    class TShape,
    class TData,
    class TRes = std::vector<TData>,
    class TTensorPtr = HostTensorPtr,
    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 std::map<size_t, TTensorPtr>& constant_data = {},
    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>.

TTensorPtr

Type of tensor pointer or reference_wrapper. Default HostTensorPtr.

UnaryOperation

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

op

Pointer to operator.

idx

Operator’s input number.

constant_data

Map with constant. Default empty.

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

TTensorPtr

Type of tensor pointer or reference_wrapper. Default HostTensorPtr.

UnaryOperation

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

op

Pointer to operator.

idx

Operator’s input number.

constant_data

Map with constant. Default empty.

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 TTensorPtr = HostTensorPtr,
    class UnaryOperation = ov::util::InTypeRange<TDimValue>
    >
std::unique_ptr<TShape> get_input_const_data_as_shape(
    const ov::Node \* op,
    size_t idx,
    const std::map<size_t, TTensorPtr>& constant_data = {},
    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

TTensorPtr

Type of tensor pointer or reference_wrapper. Default HostTensorPtr.

UnaryOperation

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

op

Pointer to operator.

idx

Operator input index.

constant_data

Map with constant data. Default empty.

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>>
    >
std::unique_ptr<TResult> get_input_bounds(
    const ov::Node \* op,
    size_t idx,
    const std::map<size_t, HostTensorPtr>& constant_data
    )

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

Parameters:

TShape

Shape type.

TData

Bound value type.

op

Operator pointer.

idx

Input index.

constant_data

Map with constant data.

Returns:

Return vector of bounds as pair lower, upper.