Change frontends namespace to ov (#8434)

* Changed namespace from ngraph to ov for OV Frontends

* Fixed python

* Fixed ONNX Editor for windows

* Try to fix centos

* Fixed code style

* Revert frontend loader
This commit is contained in:
Ilya Churaev 2021-11-10 12:48:37 +03:00 committed by GitHub
parent c8e1c8e3eb
commit 6a89eb2844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
168 changed files with 1070 additions and 987 deletions

View File

@ -422,8 +422,8 @@ CNNNetwork convert_to_cnnnetwork(std::shared_ptr<ngraph::Function>& function,
OPENVINO_SUPPRESS_DEPRECATED_END
}
ngraph::frontend::FrontEndManager& get_frontend_manager() {
static ngraph::frontend::FrontEndManager manager;
ov::frontend::FrontEndManager& get_frontend_manager() {
static ov::frontend::FrontEndManager manager;
return manager;
}
@ -471,8 +471,8 @@ CNNNetwork details::ReadNetwork(const std::string& modelPath,
// Try to load with FrontEndManager
auto& manager = get_frontend_manager();
ngraph::frontend::FrontEnd::Ptr FE;
ngraph::frontend::InputModel::Ptr inputModel;
ov::frontend::FrontEnd::Ptr FE;
ov::frontend::InputModel::Ptr inputModel;
ov::VariantVector params{ov::make_variant(model_path)};
@ -533,8 +533,8 @@ CNNNetwork details::ReadNetwork(const std::string& model,
// Try to load with FrontEndManager
auto& manager = get_frontend_manager();
ngraph::frontend::FrontEnd::Ptr FE;
ngraph::frontend::InputModel::Ptr inputModel;
ov::frontend::FrontEnd::Ptr FE;
ov::frontend::InputModel::Ptr inputModel;
ov::VariantVector params{ov::make_variant(&modelStream)};
if (weights) {

View File

@ -35,8 +35,8 @@ protected:
std::istringstream modelStringStream(model);
std::istream& modelStream = modelStringStream;
ngraph::frontend::FrontEnd::Ptr FE;
ngraph::frontend::InputModel::Ptr inputModel;
ov::frontend::FrontEnd::Ptr FE;
ov::frontend::InputModel::Ptr inputModel;
ov::VariantVector params{ov::make_variant(&modelStream)};
@ -51,7 +51,7 @@ protected:
}
private:
ngraph::frontend::FrontEndManager manager;
ov::frontend::FrontEndManager manager;
};
TEST_F(RTInfoDeserialization, NodeV10) {

View File

@ -30,8 +30,8 @@ protected:
std::shared_ptr<ngraph::Function> getWithIRFrontend(const std::string& model_path,
const std::string& weights_path) {
ngraph::frontend::FrontEnd::Ptr FE;
ngraph::frontend::InputModel::Ptr inputModel;
ov::frontend::FrontEnd::Ptr FE;
ov::frontend::InputModel::Ptr inputModel;
ov::VariantVector params{ov::make_variant(model_path), ov::make_variant(weights_path)};
@ -46,7 +46,7 @@ protected:
}
private:
ngraph::frontend::FrontEndManager manager;
ov::frontend::FrontEndManager manager;
};
TEST_F(RTInfoSerializationTest, all_attributes_latest) {

View File

@ -8,7 +8,7 @@
#include "ngraph/visibility.hpp"
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov::frontend;
FeStat FrontEndMockPy::m_stat = {};
ModelStat InputModelMockPy::m_stat = {};
@ -33,4 +33,4 @@ extern "C" MOCK_API void* GetFrontEndData()
res->m_creator = []() { return std::make_shared<FrontEndMockPy>(); };
return res;
}
}

View File

@ -18,7 +18,7 @@
// OK to have 'using' in mock header
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov::frontend;
////////////////////////////////
/// \brief This structure holds number static setup values

View File

@ -9,7 +9,7 @@
namespace py = pybind11;
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov::frontend;
static void register_mock_frontend_stat(py::module m)
{

View File

@ -10,12 +10,12 @@
#include "frontend_manager_defs.hpp"
#include "input_model.hpp"
#include "ngraph/function.hpp"
#include "ngraph/variant.hpp"
#include "openvino/core/extension.hpp"
#include "openvino/core/function.hpp"
#include "openvino/core/op_extension.hpp"
#include "openvino/core/variant.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
/// \brief An interface for identifying a frontend for a particular framework.
/// Provides an ability to load and convert of input model
@ -59,11 +59,11 @@ public:
/// possible
/// \param model Input model
/// \return fully converted nGraph function
virtual std::shared_ptr<ngraph::Function> convert(InputModel::Ptr model) const;
virtual std::shared_ptr<ov::Function> convert(InputModel::Ptr model) const;
/// \brief Completely convert the remaining, not converted part of a function.
/// \param partiallyConverted partially converted nGraph function
virtual void convert(std::shared_ptr<ngraph::Function> partially_converted) const;
virtual void convert(std::shared_ptr<ov::Function> partially_converted) const;
/// \brief Convert only those parts of the model that can be converted leaving others
/// as-is. Converted parts are not normalized by additional transformations; normalize
@ -71,18 +71,18 @@ public:
/// conversion process.
/// \param model Input model
/// \return partially converted nGraph function
virtual std::shared_ptr<ngraph::Function> convert_partially(InputModel::Ptr model) const;
virtual std::shared_ptr<ov::Function> convert_partially(InputModel::Ptr model) const;
/// \brief Convert operations with one-to-one mapping with decoding nodes.
/// Each decoding node is an nGraph node representing a single FW operation node with
/// all attributes represented in FW-independent way.
/// \param model Input model
/// \return nGraph function after decoding
virtual std::shared_ptr<ngraph::Function> decode(InputModel::Ptr model) const;
virtual std::shared_ptr<ov::Function> decode(InputModel::Ptr model) const;
/// \brief Runs normalization passes on function that was loaded with partial conversion
/// \param function partially converted nGraph function
virtual void normalize(std::shared_ptr<ngraph::Function> function) const;
virtual void normalize(std::shared_ptr<ov::Function> function) const;
/// \brief Gets name of this FrontEnd. Can be used by clients
/// if frontend is selected automatically by FrontEndManager::load_by_model
@ -136,4 +136,4 @@ inline bool FrontEnd::supported(const std::vector<std::shared_ptr<Variant>>& var
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -8,42 +8,42 @@
#include <string>
#include "frontend_manager_defs.hpp"
#include "ngraph/check.hpp"
#include "openvino/core/except.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
class FRONTEND_API GeneralFailure : public CheckFailure {
class FRONTEND_API GeneralFailure : public AssertFailure {
public:
GeneralFailure(const CheckLocInfo& check_loc_info, const std::string& context, const std::string& explanation)
: CheckFailure(check_loc_info, "FrontEnd API failed with GeneralFailure: " + context, explanation) {}
: AssertFailure(check_loc_info, "FrontEnd API failed with GeneralFailure: " + context, explanation) {}
};
class FRONTEND_API InitializationFailure : public CheckFailure {
class FRONTEND_API InitializationFailure : public AssertFailure {
public:
InitializationFailure(const CheckLocInfo& check_loc_info,
const std::string& context,
const std::string& explanation)
: CheckFailure(check_loc_info, "FrontEnd API failed with InitializationFailure: " + context, explanation) {}
: AssertFailure(check_loc_info, "FrontEnd API failed with InitializationFailure: " + context, explanation) {}
};
class FRONTEND_API OpValidationFailure : public CheckFailure {
class FRONTEND_API OpValidationFailure : public AssertFailure {
public:
OpValidationFailure(const CheckLocInfo& check_loc_info, const std::string& context, const std::string& explanation)
: CheckFailure(check_loc_info, "FrontEnd API failed with OpValidationFailure: " + context, explanation) {}
: AssertFailure(check_loc_info, "FrontEnd API failed with OpValidationFailure: " + context, explanation) {}
};
class FRONTEND_API OpConversionFailure : public CheckFailure {
class FRONTEND_API OpConversionFailure : public AssertFailure {
public:
OpConversionFailure(const CheckLocInfo& check_loc_info, const std::string& context, const std::string& explanation)
: CheckFailure(check_loc_info, "FrontEnd API failed with OpConversionFailure: " + context, explanation) {}
: AssertFailure(check_loc_info, "FrontEnd API failed with OpConversionFailure: " + context, explanation) {}
};
class FRONTEND_API NotImplementedFailure : public CheckFailure {
class FRONTEND_API NotImplementedFailure : public AssertFailure {
public:
NotImplementedFailure(const CheckLocInfo& check_loc_info,
const std::string& context,
const std::string& explanation)
: CheckFailure(check_loc_info, "FrontEnd API failed with NotImplementedFailure: " + context, explanation) {}
: AssertFailure(check_loc_info, "FrontEnd API failed with NotImplementedFailure: " + context, explanation) {}
};
/// \brief Macro to check whether a boolean condition holds.
@ -51,39 +51,39 @@ public:
/// \param ... Additional error message info to be added to the error message via the `<<`
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
/// i.e., only if the `cond` evalutes to `false`.
/// \throws ::ngraph::frontend::GeneralFailure if `cond` is false.
#define FRONT_END_GENERAL_CHECK(...) NGRAPH_CHECK_HELPER(::ngraph::frontend::GeneralFailure, "", __VA_ARGS__)
/// \throws ::ov::frontend::GeneralFailure if `cond` is false.
#define FRONT_END_GENERAL_CHECK(...) OPENVINO_ASSERT_HELPER(::ov::frontend::GeneralFailure, "", __VA_ARGS__)
/// \brief Macro to check whether a boolean condition holds.
/// \param cond Condition to check
/// \param ... Additional error message info to be added to the error message via the `<<`
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
/// i.e., only if the `cond` evalutes to `false`.
/// \throws ::ngraph::frontend::InitializationFailure if `cond` is false.
/// \throws ::ov::frontend::InitializationFailure if `cond` is false.
#define FRONT_END_INITIALIZATION_CHECK(...) \
NGRAPH_CHECK_HELPER(::ngraph::frontend::InitializationFailure, "", __VA_ARGS__)
OPENVINO_ASSERT_HELPER(::ov::frontend::InitializationFailure, "", __VA_ARGS__)
/// \brief Macro to check whether a boolean condition holds.
/// \param cond Condition to check
/// \param ... Additional error message info to be added to the error message via the `<<`
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
/// i.e., only if the `cond` evalutes to `false`.
/// \throws ::ngraph::frontend::OpConversionFailure if `cond` is false.
#define FRONT_END_OP_CONVERSION_CHECK(...) NGRAPH_CHECK_HELPER(::ngraph::frontend::OpConversionFailure, "", __VA_ARGS__)
/// \throws ::ov::frontend::OpConversionFailure if `cond` is false.
#define FRONT_END_OP_CONVERSION_CHECK(...) OPENVINO_ASSERT_HELPER(::ov::frontend::OpConversionFailure, "", __VA_ARGS__)
/// \brief Assert macro.
/// \param NAME Name of the function that is not implemented
/// \throws ::ngraph::frontend::NotImplementedFailure
#define FRONT_END_NOT_IMPLEMENTED(NAME) \
NGRAPH_CHECK_HELPER(::ngraph::frontend::NotImplementedFailure, \
"", \
false, \
#NAME " is not implemented for this FrontEnd class")
/// \throws ::ov::frontend::NotImplementedFailure
#define FRONT_END_NOT_IMPLEMENTED(NAME) \
OPENVINO_ASSERT_HELPER(::ov::frontend::NotImplementedFailure, \
"", \
false, \
#NAME " is not implemented for this FrontEnd class")
/// \brief Assert macro.
/// \param MSG Error message
/// \throws ::ngraph::frontend::GeneralFailure
/// \throws ::ov::frontend::GeneralFailure
#define FRONT_END_THROW(MSG) FRONT_END_GENERAL_CHECK(false, MSG)
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -10,10 +10,10 @@
#include "frontend.hpp"
#include "frontend_manager_defs.hpp"
#include "ngraph/variant.hpp"
#include "openvino/core/variant.hpp"
#include "parameters.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
// -------------- FrontEndManager -----------------
using FrontEndFactory = std::function<FrontEnd::Ptr()>;
@ -98,4 +98,4 @@ struct FrontEndPluginInfo {
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -4,7 +4,7 @@
#pragma once
#include "ngraph/visibility.hpp"
#include "openvino/core/visibility.hpp"
// Increment each time when FrontEnd/InputModel/Place interface is changed
#define OV_FRONTEND_API_VERSION 1

View File

@ -9,11 +9,11 @@
#include <vector>
#include "frontend_manager_defs.hpp"
#include "ngraph/partial_shape.hpp"
#include "ngraph/type/element_type.hpp"
#include "openvino/core/partial_shape.hpp"
#include "openvino/core/type/element_type.hpp"
#include "place.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
/// \brief InputModel class represents an original, not yet converted model graph in a
/// framework format given services to find places of interest in a graph or specialize/edit
@ -173,17 +173,17 @@ public:
/// converted to ngraph.
/// \param place Model place
/// \param shape Partial shape for this place
virtual void set_partial_shape(Place::Ptr place, const ngraph::PartialShape& shape);
virtual void set_partial_shape(Place::Ptr place, const ov::PartialShape& shape);
/// \brief Returns current partial shape used for this place
/// \param place Model place
/// \return Partial shape for this place
virtual ngraph::PartialShape get_partial_shape(Place::Ptr place) const;
virtual ov::PartialShape get_partial_shape(Place::Ptr place) const;
/// \brief Sets new element type for a place
/// \param place Model place
/// \param type New element type
virtual void set_element_type(Place::Ptr place, const ngraph::element::Type& type);
virtual void set_element_type(Place::Ptr place, const ov::element::Type& type);
/// \brief Freezes a tensor with statically defined value or replace existing value for
/// already constant node or tensor
@ -200,4 +200,4 @@ public:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -9,10 +9,10 @@
#include <string>
#include "frontend_manager_defs.hpp"
#include "ngraph/op/constant.hpp"
#include "ngraph/opsets/opset.hpp"
#include "openvino/core/rtti.hpp"
#include "openvino/core/variant.hpp"
#include "openvino/op/constant.hpp"
namespace ov {

View File

@ -10,7 +10,7 @@
#include "frontend_manager_defs.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
/// \brief An interface for identifying a place in a graph and iterate over it; can refer to
/// an operation node, tensor, port etc.
@ -303,4 +303,4 @@ public:
virtual bool is_equal_data(Ptr another) const;
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -12,8 +12,8 @@
#include "so_extension.hpp"
#include "utils.hpp"
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov;
using namespace ov::frontend;
//----------- FrontEndManager ---------------------------
class FrontEndManager::Impl {

View File

@ -23,8 +23,8 @@
#include "openvino/util/file_util.hpp"
#include "plugin_loader.hpp"
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov;
using namespace ov::frontend;
#ifdef WIN32
# define DLOPEN(file_str) LoadLibrary(TEXT(file_str.c_str()))
@ -73,7 +73,7 @@ static std::vector<std::string> list_files(const std::string& path) {
NGRAPH_SUPPRESS_DEPRECATED_END
}
std::vector<PluginData> ngraph::frontend::load_plugins(const std::string& dir_name) {
std::vector<PluginData> ov::frontend::load_plugins(const std::string& dir_name) {
auto files = list_files(dir_name);
std::vector<PluginData> res;
for (const auto& file : files) {

View File

@ -14,7 +14,7 @@ static const char FileSeparator[] = "/";
static const char PathSeparator[] = ":";
#endif // _WIN32
namespace ngraph {
namespace ov {
namespace frontend {
/// Plugin library handle wrapper. On destruction calls internal function which frees
/// library handle
@ -51,4 +51,4 @@ struct PluginData {
std::vector<PluginData> load_plugins(const std::string& dir_name);
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -42,7 +42,7 @@ static std::string _get_frontend_library_path() {
CHAR ie_library_path[MAX_PATH];
HMODULE hm = NULL;
if (!GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast<LPSTR>(ngraph::frontend::get_frontend_library_path),
reinterpret_cast<LPSTR>(ov::frontend::get_frontend_library_path),
&hm)) {
FRONT_END_INITIALIZATION_CHECK(false, "GetModuleHandle returned ", GetLastError());
}
@ -50,13 +50,13 @@ static std::string _get_frontend_library_path() {
return get_path_name(std::string(ie_library_path));
#elif defined(__APPLE__) || defined(__linux__)
Dl_info info;
dladdr(reinterpret_cast<void*>(ngraph::frontend::get_frontend_library_path), &info);
dladdr(reinterpret_cast<void*>(ov::frontend::get_frontend_library_path), &info);
return get_path_name(std::string(info.dli_fname)).c_str();
#else
# error "Unsupported OS"
#endif // _WIN32
}
std::string ngraph::frontend::get_frontend_library_path() {
std::string ov::frontend::get_frontend_library_path() {
return _get_frontend_library_path();
}

View File

@ -6,8 +6,8 @@
#include "frontend_manager/frontend_manager_defs.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
FRONTEND_API std::string get_frontend_library_path();
std::string get_frontend_library_path();
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -4,12 +4,11 @@
#pragma once
#include <frontend_manager/frontend.hpp>
#include <ngraph/variant.hpp>
#include "frontend_manager/frontend.hpp"
#include "openvino/core/variant.hpp"
#include "utility.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
class IR_API FrontEndIR : public FrontEnd {
@ -48,4 +47,4 @@ private:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -4,15 +4,15 @@
#pragma once
#include <frontend_manager/frontend_manager.hpp>
#include <ir_frontend/utility.hpp>
#include <istream>
#include <memory>
#include <ngraph/ngraph.hpp>
#include <openvino/core/op_extension.hpp>
namespace ngraph {
#include "frontend_manager/frontend_manager.hpp"
#include "ir_frontend/utility.hpp"
namespace ov {
namespace frontend {
class IR_API InputModelIR : public InputModel {
friend class FrontEndIR;
class InputModelIRImpl;
@ -27,4 +27,4 @@ public:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -7,18 +7,18 @@
#include <array>
#include <vector>
#include "ir_deserializer.hpp"
#include "ir_frontend/model.hpp"
#include "ir_frontend/utility.hpp"
#include "ngraph/variant.hpp"
#include "openvino/core/op_extension.hpp"
#include "ngraph/runtime/aligned_buffer.hpp"
#include "ngraph/runtime/shared_buffer.hpp"
#include "openvino/core/variant.hpp"
#include "openvino/util/file_util.hpp"
#include "so_extension.hpp"
#include "xml_parse_utils.h"
using namespace ngraph;
using namespace ov;
namespace ngraph {
namespace ov {
namespace frontend {
namespace {
@ -215,7 +215,7 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector<std::shared_ptr<Variant>
bin_stream.read(aligned_weights_buffer->get_ptr<char>(), aligned_weights_buffer->size());
bin_stream.close();
weights = std::make_shared<runtime::SharedBuffer<std::shared_ptr<runtime::AlignedBuffer>>>(
weights = std::make_shared<ngraph::runtime::SharedBuffer<std::shared_ptr<ngraph::runtime::AlignedBuffer>>>(
aligned_weights_buffer->get_ptr<char>(),
aligned_weights_buffer->size(),
aligned_weights_buffer);
@ -224,7 +224,7 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector<std::shared_ptr<Variant>
return create_input_model();
}
std::shared_ptr<ngraph::Function> FrontEndIR::convert(InputModel::Ptr model) const {
std::shared_ptr<ov::Function> FrontEndIR::convert(InputModel::Ptr model) const {
auto ir_model = std::dynamic_pointer_cast<InputModelIR>(model);
OPENVINO_ASSERT(ir_model != nullptr);
return ir_model->convert();
@ -234,9 +234,9 @@ std::string FrontEndIR::get_name() const {
return "ir";
}
} // namespace frontend
} // namespace ngraph
} // namespace ov
extern "C" IR_API ngraph::frontend::FrontEndVersion GetAPIVersion() {
extern "C" IR_API ov::frontend::FrontEndVersion GetAPIVersion() {
return OV_FRONTEND_API_VERSION;
}

View File

@ -2,18 +2,18 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <xml_parse_utils.h>
#include "ir_deserializer.hpp"
#include <ie_ngraph_utils.hpp>
#include <ir_deserializer.hpp>
#include <ngraph/op/util/framework_node.hpp>
#include <ngraph/opsets/opset1.hpp>
#include <pugixml.hpp>
#include <rt_info_deserializer.hpp>
#include <transformations/rt_info/attributes.hpp>
#include <utils.hpp>
#include "ie_ngraph_utils.hpp"
#include "ir_frontend/model.hpp"
#include "ngraph/op/util/framework_node.hpp"
#include "ngraph/opsets/opset1.hpp"
#include "rt_info_deserializer.hpp"
#include "transformations/rt_info/attributes.hpp"
#include "utils.hpp"
#include "xml_parse_utils.h"
using namespace ov;

View File

@ -4,25 +4,26 @@
#pragma once
#include <xml_parse_utils.h>
#include <ie_ngraph_utils.hpp>
#include <ir_frontend/model.hpp>
#include <istream>
#include <memory>
#include <ngraph/ngraph.hpp>
#include <pugixml.hpp>
#include <utils.hpp>
#include "ie_ngraph_utils.hpp"
#include "ir_frontend/model.hpp"
#include "openvino/core/attribute_visitor.hpp"
#include "openvino/core/op_extension.hpp"
#include "openvino/op/loop.hpp"
#include "openvino/op/util/sub_graph_base.hpp"
#include "utils.hpp"
#include "xml_parse_utils.h"
namespace ov {
struct GenericLayerParams {
struct LayerPortData {
size_t portId;
std::vector<ngraph::Dimension> dims;
ngraph::element::Type_t precision;
std::vector<ov::Dimension> dims;
ov::element::Type_t precision;
std::unordered_set<std::string> names;
};
size_t layerId;
@ -55,13 +56,13 @@ struct GenericLayerParams {
}
};
class XmlDeserializer : public ngraph::AttributeVisitor {
class XmlDeserializer : public ov::AttributeVisitor {
public:
explicit XmlDeserializer(const pugi::xml_node& node,
const std::shared_ptr<ngraph::runtime::AlignedBuffer>& weights,
const std::unordered_map<std::string, ngraph::OpSet>& opsets,
const std::unordered_map<ov::DiscreteTypeInfo, ov::BaseOpExtension::Ptr>& extensions,
std::unordered_map<std::string, std::shared_ptr<ngraph::Variable>>& variables,
std::unordered_map<std::string, std::shared_ptr<ov::op::util::Variable>>& variables,
size_t version)
: m_node(node),
m_weights(weights),
@ -70,13 +71,13 @@ public:
m_variables(variables),
m_version(version) {}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::string>& value) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::string>& value) override {
std::string val;
if (!getStrAttribute(m_node.child("data"), name, val))
return;
value.set(val);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<bool>& value) override {
void on_adapter(const std::string& name, ov::ValueAccessor<bool>& value) override {
std::string val;
if (!getStrAttribute(m_node.child("data"), name, val))
return;
@ -93,46 +94,45 @@ public:
return;
value.set(is_true);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<void>& adapter) override;
void on_adapter(const std::string& name, ov::ValueAccessor<void>& adapter) override;
void on_adapter(const std::string& name, ngraph::ValueAccessor<double>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<double>& adapter) override {
std::string val;
if (!getStrAttribute(m_node.child("data"), name, val))
return;
adapter.set(stringToType<double>(val));
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<int64_t>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<int64_t>& adapter) override {
std::string val;
if (!getStrAttribute(m_node.child("data"), name, val))
return;
adapter.set(stringToType<int64_t>(val));
}
void on_adapter(const std::string& name,
ngraph::ValueAccessor<std::shared_ptr<ngraph::Function>>& adapter) override;
void on_adapter(const std::string& name, ov::ValueAccessor<std::shared_ptr<ov::Function>>& adapter) override;
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<int32_t>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<int32_t>>& adapter) override {
std::vector<int32_t> value;
if (!getParameters<int32_t>(m_node.child("data"), name, value))
return;
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<int64_t>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<int64_t>>& adapter) override {
std::vector<int64_t> value;
if (!getParameters<int64_t>(m_node.child("data"), name, value))
return;
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<float>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<float>>& adapter) override {
std::vector<float> value;
if (!getParameters<float>(m_node.child("data"), name, value))
return;
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<std::string>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<std::string>>& adapter) override {
std::vector<std::string> value;
if (!getParameters<std::string>(m_node.child("data"), name, value))
return;
@ -149,41 +149,41 @@ private:
/// \brief Traverses port_map in order to create vector of InputDescription shared_ptrs.
/// Shall be used only for ops which have port_map attribute.
/// \param node xml op representation
std::vector<std::shared_ptr<ngraph::op::util::SubGraphOp::InputDescription>>
std::vector<std::shared_ptr<ov::op::util::SubGraphOp::InputDescription>>
parseInputDescription(const pugi::xml_node& node, const std::string& body_name, const std::string& port_map_name);
/// \brief Traverses port_map in order to create vector of OutputDescription shared_ptrs.
/// Shall be used only for ops which have port_map attribute.
/// \param node xml op representation
std::vector<std::shared_ptr<ngraph::op::util::SubGraphOp::OutputDescription>>
std::vector<std::shared_ptr<ov::op::util::SubGraphOp::OutputDescription>>
parseOutputDescription(const pugi::xml_node& node, const std::string& body_name, const std::string& port_map_name);
// TODO consider to call only once per layer/TI-Loop node
IoMap updated_io_map(const pugi::xml_node& node, const pugi::xml_node& body_node);
/// \brief Traverses xml node representation in order to create nGraph function for it.
/// \brief Traverses xml node representation in order to create ov function for it.
/// \param node xml node representation
/// \param weights weights attached to current node
/// \return shared pointer to function representing input node
std::shared_ptr<ngraph::Function> parse_function(const pugi::xml_node& root,
const std::shared_ptr<ngraph::runtime::AlignedBuffer>& weights);
std::shared_ptr<ov::Function> parse_function(const pugi::xml_node& root,
const std::shared_ptr<ngraph::runtime::AlignedBuffer>& weights);
/// \brief Traverses xml node representation in order to get the purpose attribute of
/// inputs/outputs in the body of Loop op. \param node xml node representation \return struct
/// with value of purpuse attribute
ngraph::op::v5::Loop::SpecialBodyPorts parsePurposeAttribute(const pugi::xml_node& node);
ov::op::v5::Loop::SpecialBodyPorts parsePurposeAttribute(const pugi::xml_node& node);
GenericLayerParams parseGenericParams(const pugi::xml_node& node);
std::shared_ptr<ngraph::Node> createNode(const ngraph::OutputVector& inputs,
const pugi::xml_node& node,
const ov::Weights& weights,
const GenericLayerParams& params);
std::shared_ptr<ov::Node> createNode(const ov::OutputVector& inputs,
const pugi::xml_node& node,
const ov::Weights& weights,
const GenericLayerParams& params);
// -- DATA --
const pugi::xml_node m_node;
const ov::Weights& m_weights;
const std::unordered_map<std::string, ngraph::OpSet>& m_opsets;
const std::unordered_map<ov::DiscreteTypeInfo, ov::BaseOpExtension::Ptr>& m_extensions;
std::unordered_map<std::string, std::shared_ptr<ngraph::Variable>>& m_variables;
std::unordered_map<std::string, std::shared_ptr<ov::op::util::Variable>>& m_variables;
///
/// store information about parameters/results order during function creation

View File

@ -11,6 +11,8 @@
#include <openvino/op/util/framework_node.hpp>
#include <pugixml.hpp>
#include "openvino/core/validation_util.hpp"
using namespace ngraph;
using namespace InferenceEngine;
@ -182,7 +184,7 @@ void ParsePreProcess(pugi::xml_node& root,
}
} // namespace
namespace ngraph {
namespace ov {
namespace frontend {
class InputModelIR::InputModelIRImpl {
std::shared_ptr<ngraph::runtime::AlignedBuffer> m_weights;
@ -239,4 +241,4 @@ std::shared_ptr<Function> InputModelIR::InputModelIRImpl::convert() {
return function;
}
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -9,16 +9,16 @@
using namespace ov;
void RTInfoDeserializer::on_adapter(const std::string& name, ngraph::ValueAccessor<void>& adapter) {
void RTInfoDeserializer::on_adapter(const std::string& name, ValueAccessor<void>& adapter) {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
return;
if (auto a = ngraph::as_type<ngraph::AttributeAdapter<std::set<std::string>>>(&adapter)) {
if (auto a = as_type<AttributeAdapter<std::set<std::string>>>(&adapter)) {
std::set<std::string> ss;
str_to_container(val, ss);
a->set(ss);
} else {
IR_THROW("Not implemented");
}
}
}

View File

@ -4,18 +4,19 @@
#pragma once
#include <ir_frontend/utility.hpp>
#include <istream>
#include <memory>
#include <ngraph/ngraph.hpp>
#include <utils.hpp>
#include "ir_frontend/utility.hpp"
#include "openvino/core/attribute_visitor.hpp"
#include "utils.hpp"
namespace ov {
class RTInfoDeserializer : public ngraph::AttributeVisitor {
class RTInfoDeserializer : public ov::AttributeVisitor {
public:
explicit RTInfoDeserializer(const pugi::xml_node& node) : m_node(node) {}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::string>& value) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::string>& value) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -23,7 +24,7 @@ public:
value.set(val);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<bool>& value) override {
void on_adapter(const std::string& name, ov::ValueAccessor<bool>& value) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -42,16 +43,16 @@ public:
value.set(is_true);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<void>& adapter) override;
void on_adapter(const std::string& name, ov::ValueAccessor<void>& adapter) override;
void on_adapter(const std::string& name, ngraph::ValueAccessor<double>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<double>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
return;
adapter.set(stringToType<double>(val));
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<int64_t>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<int64_t>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -59,12 +60,11 @@ public:
adapter.set(stringToType<int64_t>(val));
}
void on_adapter(const std::string& name,
ngraph::ValueAccessor<std::shared_ptr<ngraph::Function>>& adapter) override {
throw ngraph::ngraph_error("Function type is unsupported for rt info deserialization");
void on_adapter(const std::string& name, ov::ValueAccessor<std::shared_ptr<ov::Function>>& adapter) override {
throw ov::Exception("Function type is unsupported for rt info deserialization");
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<int32_t>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<int32_t>>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -74,7 +74,7 @@ public:
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<int64_t>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<int64_t>>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -84,7 +84,7 @@ public:
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<float>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<float>>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -94,7 +94,7 @@ public:
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<uint64_t>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<uint64_t>>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -104,7 +104,7 @@ public:
adapter.set(value);
}
void on_adapter(const std::string& name, ngraph::ValueAccessor<std::vector<std::string>>& adapter) override {
void on_adapter(const std::string& name, ov::ValueAccessor<std::vector<std::string>>& adapter) override {
check_attribute_name(name);
std::string val;
if (!getStrAttribute(m_node, name, val))
@ -116,11 +116,11 @@ public:
void check_attribute_name(const std::string& name) const {
if (name == "name" || name == "version") {
throw ngraph::ngraph_error("Attribute key with name: " + name + " is not allowed. Please use another name");
throw ov::Exception("Attribute key with name: " + name + " is not allowed. Please use another name");
}
}
private:
pugi::xml_node m_node;
};
} // namespace ov
} // namespace ov

View File

@ -4,9 +4,12 @@
#include "utils.hpp"
#include "ie_ngraph_utils.hpp"
#include "openvino/util/common_util.hpp"
namespace ov {
void operator>>(const std::stringstream& in, ngraph::element::Type& type) {
type = InferenceEngine::details::convertPrecision(ngraph::trim(in.str()));
void operator>>(const std::stringstream& in, ov::element::Type& type) {
type = InferenceEngine::details::convertPrecision(ov::util::trim(in.str()));
}
bool getStrAttribute(const pugi::xml_node& node, const std::string& name, std::string& value) {
@ -19,4 +22,4 @@ bool getStrAttribute(const pugi::xml_node& node, const std::string& name, std::s
value = std::string(attr.value());
return true;
}
} // namespace ov
} // namespace ov

View File

@ -4,16 +4,13 @@
#pragma once
#include <xml_parse_utils.h>
#include <ie_ngraph_utils.hpp>
#include <istream>
#include <memory>
#include <ngraph/ngraph.hpp>
#include <pugixml.hpp>
#include "openvino/core/type/element_type.hpp"
#include "xml_parse_utils.h"
namespace ov {
void operator>>(const std::stringstream& in, ngraph::element::Type& type);
void operator>>(const std::stringstream& in, ov::element::Type& type);
bool getStrAttribute(const pugi::xml_node& node, const std::string& name, std::string& value);
@ -49,4 +46,4 @@ T stringToType(const std::string& valStr) {
}
return ret;
}
} // namespace ov
} // namespace ov

View File

@ -12,13 +12,13 @@
# define ONNX_FRONTEND_API OPENVINO_CORE_IMPORTS
#endif
namespace ngraph {
namespace ov {
namespace frontend {
class ONNX_FRONTEND_API FrontEndONNX : public FrontEnd {
public:
std::shared_ptr<ngraph::Function> convert(InputModel::Ptr model) const override;
void convert(std::shared_ptr<ngraph::Function> partially_converted) const override;
std::shared_ptr<ngraph::Function> decode(InputModel::Ptr model) const override;
std::shared_ptr<ov::Function> convert(InputModel::Ptr model) const override;
void convert(std::shared_ptr<ov::Function> partially_converted) const override;
std::shared_ptr<ov::Function> decode(InputModel::Ptr model) const override;
std::string get_name() const override;
bool supported_impl(const std::vector<std::shared_ptr<Variant>>& variants) const override;
@ -27,5 +27,4 @@ protected:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -11,7 +11,7 @@
#include "ngraph/check.hpp"
using namespace ngraph::onnx_editor;
using namespace ov::onnx_editor;
enum class PortType { InputPort, OutputPort };

View File

@ -18,7 +18,7 @@ class NodeProto;
class ValueInfoProto;
} // namespace ONNX_NAMESPACE
namespace ngraph {
namespace ov {
namespace onnx_editor {
/// \brief Subgraph extraction helper structure
struct SubgraphExtractor {
@ -95,4 +95,4 @@ private:
void extract_subgraph_from_onnx_model(const SubgraphComponents& subgraph);
};
} // namespace onnx_editor
} // namespace ngraph
} // namespace ov

View File

@ -11,8 +11,8 @@
#include "ngraph/check.hpp"
#include "ngraph/except.hpp"
using namespace ngraph;
using namespace ngraph::onnx_editor;
using namespace ov;
using namespace ov::onnx_editor;
onnx_editor::EdgeMapper::EdgeMapper(const ONNX_NAMESPACE::GraphProto& graph_proto)
: m_node_inputs(graph_proto.node().size()),
@ -66,8 +66,8 @@ int onnx_editor::EdgeMapper::get_node_output_idx(int node_index, const std::stri
const auto& node_outputs = m_node_outputs[node_index];
const auto out_port_idx = std::find(std::begin(node_outputs), std::end(node_outputs), output_name);
if (out_port_idx == std::end(node_outputs)) {
throw ngraph_error("Node with index: " + std::to_string(node_index) +
" has not output with name: " + output_name);
throw ov::Exception("Node with index: " + std::to_string(node_index) +
" has not output with name: " + output_name);
}
return (out_port_idx - std::begin(node_outputs));
}
@ -88,8 +88,8 @@ std::vector<int> onnx_editor::EdgeMapper::get_node_input_indexes(int node_index,
++index;
}
if (node_inputs_indexes.size() == 0) {
throw ngraph_error("Node with index: " + std::to_string(node_index) +
" has not input with name: " + input_name);
throw ov::Exception("Node with index: " + std::to_string(node_index) +
" has not input with name: " + input_name);
}
return node_inputs_indexes;
}
@ -102,9 +102,9 @@ InputEdge onnx_editor::EdgeMapper::find_input_edge(const EditorNode& node, const
if (node_indexes.size() == 1) {
node_index = node_indexes[0];
} else if (node_indexes.empty()) {
throw ngraph_error("Node with name: " + (node.m_node_name.empty() ? "not_given" : node.m_node_name) +
" and output_name: " + (node.m_output_name.empty() ? "not_given" : node.m_output_name) +
" was not found");
throw ov::Exception("Node with name: " + (node.m_node_name.empty() ? "not_given" : node.m_node_name) +
" and output_name: " + (node.m_output_name.empty() ? "not_given" : node.m_output_name) +
" was not found");
} else if (!in.m_input_name.empty()) // input indexes are not deterministic if a node name is ambiguous
{
// many nodes with the same name
@ -117,16 +117,16 @@ InputEdge onnx_editor::EdgeMapper::find_input_edge(const EditorNode& node, const
}
}
if (matched_inputs_number == 0) {
throw ngraph_error("Input edge described by: " + node.m_node_name +
" and input name: " + in.m_input_name + " was not found");
throw ov::Exception("Input edge described by: " + node.m_node_name +
" and input name: " + in.m_input_name + " was not found");
}
if (matched_inputs_number > 1) {
throw ngraph_error("Given node name: " + node.m_node_name + " and input name: " + in.m_input_name +
" are ambiguous to determine input edge");
throw ov::Exception("Given node name: " + node.m_node_name + " and input name: " + in.m_input_name +
" are ambiguous to determine input edge");
}
} else {
throw ngraph_error("Given node name: " + node.m_node_name + " and input index: " +
std::to_string(in.m_input_index) + " are ambiguous to determine input edge");
throw ov::Exception("Given node name: " + node.m_node_name + " and input index: " +
std::to_string(in.m_input_index) + " are ambiguous to determine input edge");
}
} else { // the node index is provided
check_node_index(node_index);
@ -139,13 +139,13 @@ InputEdge onnx_editor::EdgeMapper::find_input_edge(const EditorNode& node, const
const auto input_indexes = get_node_input_indexes(node_index, in.m_input_name);
if (input_indexes.size() > 1) // more indexes with the same name
{
throw ngraph_error("Node with index: " + std::to_string(node_index) +
" has more than one inputs with name: " + in.m_input_name +
". You should use port indexes to distinguish them.");
throw ov::Exception("Node with index: " + std::to_string(node_index) +
" has more than one inputs with name: " + in.m_input_name +
". You should use port indexes to distinguish them.");
}
return InputEdge{node_index, input_indexes[0], in.m_new_input_name};
} else {
throw ngraph_error("Not enough information to determine input edge");
throw ov::Exception("Not enough information to determine input edge");
}
}
@ -157,9 +157,9 @@ OutputEdge onnx_editor::EdgeMapper::find_output_edge(const EditorNode& node, con
if (node_indexes.size() == 1) {
node_index = node_indexes[0];
} else if (node_indexes.empty()) {
throw ngraph_error("Node with name: " + (node.m_node_name.empty() ? "not_given" : node.m_node_name) +
" and output_name: " + (node.m_output_name.empty() ? "not_given" : node.m_output_name) +
" was not found");
throw ov::Exception("Node with name: " + (node.m_node_name.empty() ? "not_given" : node.m_node_name) +
" and output_name: " + (node.m_output_name.empty() ? "not_given" : node.m_output_name) +
" was not found");
} else if (!out.m_output_name.empty()) // output indexes are not deterministic if a node name is ambiguous
{
// many nodes with the same name
@ -173,12 +173,12 @@ OutputEdge onnx_editor::EdgeMapper::find_output_edge(const EditorNode& node, con
}
}
if (matched_outputs_number == 0) {
throw ngraph_error("Output edge described by: " + node.m_node_name +
" and output name: " + out.m_output_name + " was not found");
throw ov::Exception("Output edge described by: " + node.m_node_name +
" and output name: " + out.m_output_name + " was not found");
}
} else {
throw ngraph_error("Given node name: " + node.m_node_name + " and output index: " +
std::to_string(out.m_output_index) + " are ambiguous to determine output edge");
throw ov::Exception("Given node name: " + node.m_node_name + " and output index: " +
std::to_string(out.m_output_index) + " are ambiguous to determine output edge");
}
} else { // the node index is provided
check_node_index(node_index);
@ -191,7 +191,7 @@ OutputEdge onnx_editor::EdgeMapper::find_output_edge(const EditorNode& node, con
const auto output_idx = get_node_output_idx(node_index, out.m_output_name);
return OutputEdge{node_index, output_idx};
} else {
throw ngraph_error("Not enough information to determine output edge");
throw ov::Exception("Not enough information to determine output edge");
}
}

View File

@ -16,7 +16,7 @@ namespace ONNX_NAMESPACE {
class GraphProto;
} // namespace ONNX_NAMESPACE
namespace ngraph {
namespace ov {
namespace onnx_editor {
/// \brief A class which allows specifying InputEdge and OutputEdge by user-friendly ONNX
/// names.
@ -149,4 +149,4 @@ private:
std::multimap<std::string, int> m_output_consumers_index;
};
} // namespace onnx_editor
} // namespace ngraph
} // namespace ov

View File

@ -17,8 +17,8 @@
#include "onnx_common/utils.hpp"
#include "utils/onnx_internal.hpp"
using namespace ngraph;
using namespace ngraph::onnx_editor;
using namespace ov;
using namespace ov::onnx_editor;
NGRAPH_SUPPRESS_DEPRECATED_START
@ -69,25 +69,25 @@ ValueInfoProto* find_graph_value_info(GraphProto& graph, const std::string& name
void modify_input_type(ValueInfoProto& onnx_input, const element::Type_t elem_type) {
if (!onnx_input.has_type()) {
throw ngraph_error("The input is malformed - it doesn't contain the 'type' field. Cannot change the "
"data type. Input name: " +
onnx_input.name());
throw ov::Exception("The input is malformed - it doesn't contain the 'type' field. Cannot change the "
"data type. Input name: " +
onnx_input.name());
}
auto* type_proto = onnx_input.mutable_type();
if (!type_proto->has_tensor_type()) {
throw ngraph_error("The input is malformed - it doesn't contain the 'tensor_type' field. Cannot "
"change the data type. Input name: " +
onnx_input.name());
throw ov::Exception("The input is malformed - it doesn't contain the 'tensor_type' field. Cannot "
"change the data type. Input name: " +
onnx_input.name());
}
auto* tensor_type = type_proto->mutable_tensor_type();
if (onnx_common::is_supported_ng_type(elem_type)) {
tensor_type->set_elem_type(onnx_common::ng_to_onnx_data_type(elem_type));
if (ngraph::onnx_common::is_supported_ng_type(elem_type)) {
tensor_type->set_elem_type(ngraph::onnx_common::ng_to_onnx_data_type(elem_type));
} else {
throw ngraph_error("The input type for input '" + onnx_input.name() + "' cannot be set to: " +
element::Type(elem_type).get_type_name() + ". This type is not allowed in ONNX.");
throw ov::Exception("The input type for input '" + onnx_input.name() + "' cannot be set to: " +
element::Type(elem_type).get_type_name() + ". This type is not allowed in ONNX.");
}
}
@ -106,16 +106,16 @@ void add_dim_to_onnx_shape(const Dimension& dim, ONNX_NAMESPACE::TensorShapeProt
void modify_input_shape(ValueInfoProto& onnx_input, const PartialShape& new_shape) {
if (!onnx_input.has_type()) {
throw ngraph_error("The input is malformed - it doesn't contain the 'type' field. Cannot change the "
"input shape. Input name: " +
onnx_input.name());
throw ov::Exception("The input is malformed - it doesn't contain the 'type' field. Cannot change the "
"input shape. Input name: " +
onnx_input.name());
}
auto* type_proto = onnx_input.mutable_type();
if (!type_proto->has_tensor_type()) {
throw ngraph_error("The input is malformed - it doesn't contain the 'tensor_type' field. Cannot "
"change the input shape. Input name: " +
onnx_input.name());
throw ov::Exception("The input is malformed - it doesn't contain the 'tensor_type' field. Cannot "
"change the input shape. Input name: " +
onnx_input.name());
}
auto* tensor_type = type_proto->mutable_tensor_type();
@ -144,22 +144,22 @@ void modify_initializer(TensorProto& initializer,
const std::shared_ptr<ngraph::op::Constant> values,
ValueInfoProto* input) {
const auto elem_type = values->get_element_type();
if (!onnx_common::is_supported_ng_type(elem_type)) {
throw ngraph_error("Initializer '" + name + "' type cannot be set to: " +
element::Type(elem_type).get_type_name() + ". This type is not allowed in ONNX.");
if (!ngraph::onnx_common::is_supported_ng_type(elem_type)) {
throw ov::Exception("Initializer '" + name + "' type cannot be set to: " +
element::Type(elem_type).get_type_name() + ". This type is not allowed in ONNX.");
}
initializer.Clear();
initializer.set_name(name);
initializer.set_data_type(onnx_common::ng_to_onnx_data_type(values->get_element_type()));
initializer.set_data_type(ngraph::onnx_common::ng_to_onnx_data_type(values->get_element_type()));
for (const auto& dim : values->get_shape()) {
initializer.add_dims(dim);
}
const auto data_size_in_bytes =
shape_size(values->get_shape()) * onnx_common::get_onnx_data_size(initializer.data_type());
shape_size(values->get_shape()) * ngraph::onnx_common::get_onnx_data_size(initializer.data_type());
initializer.set_raw_data(values->get_data_ptr(), data_size_in_bytes);
// update input with type and shape of initializer
@ -206,14 +206,17 @@ struct onnx_editor::ONNXModelEditor::Impl {
Impl() = delete;
Impl(const std::string& model_path)
: m_model_proto{std::make_shared<ONNX_NAMESPACE::ModelProto>(onnx_common::parse_from_file(model_path))} {}
: m_model_proto{
std::make_shared<ONNX_NAMESPACE::ModelProto>(ngraph::onnx_common::parse_from_file(model_path))} {}
Impl(std::istream& model_stream)
: m_model_proto{std::make_shared<ONNX_NAMESPACE::ModelProto>(onnx_common::parse_from_istream(model_stream))} {}
: m_model_proto{
std::make_shared<ONNX_NAMESPACE::ModelProto>(ngraph::onnx_common::parse_from_istream(model_stream))} {}
#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
Impl(const std::wstring& model_path)
: m_model_proto{std::make_shared<ONNX_NAMESPACE::ModelProto>(onnx_common::parse_from_file(model_path))} {}
: m_model_proto{
std::make_shared<ONNX_NAMESPACE::ModelProto>(ngraph::onnx_common::parse_from_file(model_path))} {}
#endif
};
@ -225,7 +228,7 @@ onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::string& model_path)
#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::wstring& model_path)
: m_model_path{file_util::wstring_to_string(model_path)},
: m_model_path{ngraph::file_util::wstring_to_string(model_path)},
m_pimpl{new ONNXModelEditor::Impl{model_path}, [](Impl* impl) {
delete impl;
}} {}
@ -245,11 +248,11 @@ void onnx_editor::ONNXModelEditor::serialize(const std::string& out_file_path) c
std::ofstream out_file{out_file_path, std::ios::out | std::ios::binary};
if (!out_file.is_open()) {
throw ngraph_error("Could not open the file: " + out_file_path);
throw ov::Exception("Could not open the file: " + out_file_path);
};
if (!m_pimpl->m_model_proto->SerializeToOstream(&out_file)) {
throw ngraph_error("Could not serialize the model to: " + out_file_path);
throw ov::Exception("Could not serialize the model to: " + out_file_path);
} else {
out_file.close();
}
@ -263,8 +266,8 @@ void onnx_editor::ONNXModelEditor::set_input_types(const std::map<std::string, e
if (onnx_input != nullptr) {
modify_input_type(*onnx_input, input_desc.second);
} else {
throw ngraph_error("Could not set a custom element type for input: " + input_desc.first +
". Such input was not found in the original ONNX model.");
throw ov::Exception("Could not set a custom element type for input: " + input_desc.first +
". Such input was not found in the original ONNX model.");
}
}
}
@ -277,8 +280,8 @@ void onnx_editor::ONNXModelEditor::set_input_shapes(const std::map<std::string,
if (onnx_input != nullptr) {
modify_input_shape(*onnx_input, input_desc.second);
} else {
throw ngraph_error("Could not set custom shape for input: " + input_desc.first +
". Such input was not found in the original ONNX model.");
throw ov::Exception("Could not set custom shape for input: " + input_desc.first +
". Such input was not found in the original ONNX model.");
}
}
}
@ -315,14 +318,14 @@ PartialShape onnx_editor::ONNXModelEditor::get_tensor_shape(const std::string& t
if (value_info != nullptr) {
const auto& onnx_tensor_type = value_info->type().tensor_type();
if (onnx_tensor_type.has_shape()) {
return onnx_common::to_ng_shape(onnx_tensor_type.shape());
return ngraph::onnx_common::to_ng_shape(onnx_tensor_type.shape());
} else {
return PartialShape::dynamic();
}
} else if (tensor) {
return PartialShape{Shape{tensor->dims().cbegin(), tensor->dims().cend()}};
} else {
throw ngraph_error("The tensor: " + tensor_name + " was not found in the graph");
throw ov::Exception("The tensor: " + tensor_name + " was not found in the graph");
}
}
@ -405,7 +408,7 @@ std::string onnx_editor::ONNXModelEditor::model_string() const {
}
std::shared_ptr<Function> onnx_editor::ONNXModelEditor::get_function() const {
return onnx_import::detail::import_onnx_model(m_pimpl->m_model_proto, m_model_path);
return ngraph::onnx_import::detail::import_onnx_model(m_pimpl->m_model_proto, m_model_path);
}
void onnx_editor::ONNXModelEditor::set_input_values(
@ -584,5 +587,5 @@ std::vector<std::string> onnx_editor::ONNXModelEditor::get_output_ports(const Ed
}
std::shared_ptr<Function> onnx_editor::ONNXModelEditor::decode() {
return onnx_import::detail::decode_to_framework_nodes(m_pimpl->m_model_proto, m_model_path);
return ngraph::onnx_import::detail::decode_to_framework_nodes(m_pimpl->m_model_proto, m_model_path);
}

View File

@ -15,7 +15,7 @@
#include "ngraph/type/element_type.hpp"
#include "onnx_import/onnx_importer_visibility.hpp"
namespace ngraph {
namespace ov {
namespace onnx_editor {
/// \brief A class representing a set of utilities allowing modification of an ONNX model
///
@ -275,4 +275,4 @@ private:
std::unique_ptr<Impl, void (*)(Impl*)> m_pimpl;
};
} // namespace onnx_editor
} // namespace ngraph
} // namespace ov

View File

@ -7,7 +7,7 @@
#include <string>
#include <utility>
namespace ngraph {
namespace ov {
enum class EdgeType { INPUT, OUTPUT };
template <EdgeType>
@ -124,4 +124,4 @@ struct EditorNode {
int m_node_index = -1;
};
} // namespace onnx_editor
} // namespace ngraph
} // namespace ov

View File

@ -13,8 +13,8 @@
#include "onnx_common/onnx_model_validator.hpp"
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov;
using namespace ov::frontend;
using VariantString = VariantWrapper<std::string>;
using VariantWString = VariantWrapper<std::wstring>;
@ -71,7 +71,7 @@ std::shared_ptr<ngraph::Function> FrontEndONNX::convert(InputModel::Ptr model) c
}
void FrontEndONNX::convert(std::shared_ptr<ngraph::Function> partially_converted) const {
onnx_import::detail::convert_decoded_function(partially_converted);
ngraph::onnx_import::detail::convert_decoded_function(partially_converted);
}
std::shared_ptr<ngraph::Function> FrontEndONNX::decode(InputModel::Ptr model) const {
@ -123,14 +123,14 @@ bool FrontEndONNX::supported_impl(const std::vector<std::shared_ptr<Variant>>& v
#endif
if (model_stream.is_open()) {
model_stream.seekg(0, model_stream.beg);
const bool is_valid_model = onnx_common::is_valid_model(model_stream);
const bool is_valid_model = ngraph::onnx_common::is_valid_model(model_stream);
model_stream.close();
return is_valid_model;
}
if (ov::is_type<VariantIstreamPtr>(variants[0])) {
const auto stream = ov::as_type_ptr<VariantIstreamPtr>(variants[0])->get();
StreamRewinder rwd{*stream};
return onnx_common::is_valid_model(*stream);
return ngraph::onnx_common::is_valid_model(*stream);
}
return false;
}

View File

@ -5,12 +5,12 @@
#include "input_model.hpp"
#include <frontend_manager/frontend_exceptions.hpp>
#include <ngraph/file_util.hpp>
#include <openvino/util/file_util.hpp>
#include "place.hpp"
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov;
using namespace ov::frontend;
NGRAPH_SUPPRESS_DEPRECATED_START
@ -28,8 +28,10 @@ InputModelONNX::InputModelONNX(std::istream& model_stream)
InputModelONNX::InputModelONNX(std::istream& model_stream, const std::string& path)
: m_editor{std::make_shared<onnx_editor::ONNXModelEditor>(model_stream, path)} {}
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
InputModelONNX::InputModelONNX(std::istream& model_stream, const std::wstring& path)
: InputModelONNX(model_stream, file_util::wstring_to_string(path)) {}
: InputModelONNX(model_stream, ov::util::wstring_to_string(path)) {}
#endif
std::vector<Place::Ptr> InputModelONNX::get_inputs() const {
const auto& inputs = m_editor->model_inputs();

View File

@ -8,7 +8,7 @@
#include <frontend_manager/input_model.hpp>
#include <fstream>
namespace ngraph {
namespace ov {
namespace frontend {
class InputModelONNX : public InputModel {
public:
@ -20,7 +20,9 @@ public:
// The path can be required even if the model is passed as a stream because it is necessary
// for ONNX external data feature
InputModelONNX(std::istream& model_stream, const std::string& path);
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
InputModelONNX(std::istream& model_stream, const std::wstring& path);
#endif
std::vector<Place::Ptr> get_inputs() const override;
std::vector<Place::Ptr> get_outputs() const override;
@ -54,7 +56,7 @@ public:
void extract_subgraph(const std::vector<Place::Ptr>& inputs, const std::vector<Place::Ptr>& outputs) override;
private:
std::shared_ptr<onnx_editor::ONNXModelEditor> m_editor;
std::shared_ptr<ov::onnx_editor::ONNXModelEditor> m_editor;
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,8 +6,8 @@
#include <frontend_manager/frontend_exceptions.hpp>
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov;
using namespace ov::frontend;
PlaceInputEdgeONNX::PlaceInputEdgeONNX(const onnx_editor::InputEdge& edge,
std::shared_ptr<onnx_editor::ONNXModelEditor> editor)

View File

@ -9,7 +9,7 @@
#include <memory>
#include <sstream>
namespace ngraph {
namespace ov {
namespace frontend {
class PlaceInputEdgeONNX : public Place {
public:
@ -126,4 +126,4 @@ private:
std::shared_ptr<onnx_editor::ONNXModelEditor> m_editor;
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,9 +5,8 @@
#pragma once
#include <frontend_manager/frontend_exceptions.hpp>
#include <ngraph/node.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
class NodeContext;
@ -31,7 +30,7 @@ private:
/// \param ... Additional error message info to be added to the error message via the `<<`
/// stream-insertion operator. Note that the expressions here will be evaluated lazily,
/// i.e., only if the `cond` evalutes to `false`.
/// \throws ::ngraph::OpValidationFailurePDPD if `cond` is false.
/// \throws ::ov::OpValidationFailurePDPD if `cond` is false.
#define PDPD_OP_VALIDATION_CHECK(node_context, ...) \
NGRAPH_CHECK_HELPER(::ngraph::frontend::pdpd::OpValidationFailurePDPD, (node_context), __VA_ARGS__)
} // namespace ngraph
OPENVINO_ASSERT_HELPER(::ov::frontend::pdpd::OpValidationFailurePDPD, (node_context), __VA_ARGS__)
} // namespace ov

View File

@ -9,7 +9,7 @@
#include "exceptions.hpp"
#include "model.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
class OpPlacePDPD;
@ -69,4 +69,4 @@ private:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -7,7 +7,7 @@
#include <frontend_manager/frontend_manager.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
class OpPlacePDPD;
class TensorPlacePDPD;
@ -32,11 +32,11 @@ public:
void override_all_outputs(const std::vector<Place::Ptr>& outputs) override;
void override_all_inputs(const std::vector<Place::Ptr>& inputs) override;
void extract_subgraph(const std::vector<Place::Ptr>& inputs, const std::vector<Place::Ptr>& outputs) override;
void set_partial_shape(Place::Ptr place, const ngraph::PartialShape&) override;
ngraph::PartialShape get_partial_shape(Place::Ptr place) const override;
void set_element_type(Place::Ptr place, const ngraph::element::Type&) override;
void set_partial_shape(Place::Ptr place, const ov::PartialShape&) override;
ov::PartialShape get_partial_shape(Place::Ptr place) const override;
void set_element_type(Place::Ptr place, const ov::element::Type&) override;
void set_tensor_value(Place::Ptr place, const void* value) override;
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -17,7 +17,7 @@ class VarDesc;
} // namespace framework
} // namespace paddle
namespace ngraph {
namespace ov {
namespace frontend {
class TensorPlacePDPD;
class OpPlacePDPD;
@ -196,4 +196,4 @@ private:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -15,7 +15,7 @@
#include "framework.pb.h"
namespace ngraph {
namespace ov {
namespace frontend {
using namespace paddle::framework;
@ -153,4 +153,4 @@ std::map<std::string, OutputVector> DecoderPDPDProto::map_for_each_output(
}
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -9,7 +9,6 @@
#include <fstream>
#include <map>
#include <memory>
#include <ngraph/ngraph.hpp>
#include <paddlepaddle_frontend/frontend.hpp>
#include <paddlepaddle_frontend/place.hpp>
#include <string>
@ -19,7 +18,7 @@
#include "framework.pb.h"
#include "node_context.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
extern std::map<paddle::framework::proto::VarType_Type, ngraph::element::Type> TYPE_MAP;
@ -51,4 +50,4 @@ private:
};
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -4,7 +4,7 @@
#include "ngraph/opsets/opset8.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -13,4 +13,4 @@ namespace default_opset = ngraph::opset8;
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "node_context.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
std::string OpValidationFailurePDPD::get_error_msg_prefix_pdpd(const pdpd::NodeContext& node) {
@ -16,4 +16,4 @@ std::string OpValidationFailurePDPD::get_error_msg_prefix_pdpd(const pdpd::NodeC
}
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,8 +5,8 @@
#include <fstream>
#include <map>
#include <ngraph/ngraph.hpp>
#include <ngraph/opsets/opset7.hpp>
#include <ngraph/variant.hpp>
#include <openvino/opsets/opset7.hpp>
#include <paddlepaddle_frontend/exceptions.hpp>
#include <paddlepaddle_frontend/frontend.hpp>
#include <paddlepaddle_frontend/model.hpp>
@ -21,11 +21,11 @@
#include "pdpd_fw_node.hpp"
#include "pdpd_utils.hpp"
using namespace ngraph::opset7;
using namespace ngraph;
using namespace ngraph::frontend;
using namespace ov::opset7;
using namespace ov;
using namespace ov::frontend;
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace {
@ -84,7 +84,7 @@ NamedOutputs make_framework_node(const std::map<pdpd::TensorName, Output<Node>>&
}
auto node =
std::make_shared<ngraph::frontend::PDPDFrameworkNode>(DecoderPDPDProto(op_place), inputs_vector, inputs_names);
std::make_shared<ov::frontend::PDPDFrameworkNode>(DecoderPDPDProto(op_place), inputs_vector, inputs_names);
return node->return_named_outputs();
}
@ -326,7 +326,7 @@ std::string FrontEndPDPD::get_name() const {
return "paddle";
}
} // namespace frontend
} // namespace ngraph
} // namespace ov
extern "C" PDPD_API FrontEndVersion GetAPIVersion() {
return OV_FRONTEND_API_VERSION;

View File

@ -3,7 +3,7 @@
//
#include <fstream>
#include <ngraph/opsets/opset7.hpp>
#include <openvino/opsets/opset7.hpp>
#include <paddlepaddle_frontend/exceptions.hpp>
#include <paddlepaddle_frontend/model.hpp>
#include <paddlepaddle_frontend/place.hpp>
@ -19,7 +19,7 @@
# include <locale>
#endif
namespace ngraph {
namespace ov {
namespace frontend {
using namespace paddle::framework::proto;
@ -463,4 +463,4 @@ void InputModelPDPD::set_tensor_value(Place::Ptr place, const void* value) {
}
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -3,10 +3,10 @@
//
#pragma once
#include <ngraph/compatibility.hpp>
#include <ngraph/variant.hpp>
#include <paddlepaddle_frontend/exceptions.hpp>
#include <paddlepaddle_frontend/utility.hpp>
#include "ngraph/compatibility.hpp"
#include "openvino/core/variant.hpp"
#include "paddlepaddle_frontend/exceptions.hpp"
#include "paddlepaddle_frontend/utility.hpp"
#define NGRAPH_VARIANT_DECLARATION(TYPE, info) \
template <> \
@ -24,9 +24,6 @@ NGRAPH_VARIANT_DECLARATION(std::vector<float>, "Variant::float_vector");
NGRAPH_VARIANT_DECLARATION(bool, "Variant::bool");
NGRAPH_VARIANT_DECLARATION(ngraph::element::Type, "Variant::element_type");
NGRAPH_VARIANT_DECLARATION(std::vector<int64_t>, "Variant::int64_vector");
} // namespace ov
namespace ngraph {
namespace frontend {
namespace pdpd {
using InPortName = std::string;
@ -202,4 +199,4 @@ inline NamedOutputs NodeContext::default_single_output_mapping(
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -38,4 +38,4 @@ NamedOutputs argmax(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,9 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
#include <openvino/opsets/opset6.hpp>
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -46,4 +46,4 @@ NamedOutputs assign_value(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -47,4 +47,4 @@ NamedOutputs batch_norm(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -19,4 +19,4 @@ NamedOutputs cast(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -21,4 +21,4 @@ NamedOutputs clip(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,20 +2,20 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset6.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
NamedOutputs concat(const NodeContext& node) {
auto data = node.get_ng_inputs("X");
auto axis = node.get_attribute<int>("axis");
return node.default_single_output_mapping({std::make_shared<ngraph::opset6::Concat>(data, axis)}, {"Out"});
return node.default_single_output_mapping({std::make_shared<ov::opset6::Concat>(data, axis)}, {"Out"});
}
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset6.hpp>
#include <openvino/opsets/opset6.hpp>
#include "conv2d_utils.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -17,4 +17,4 @@ NamedOutputs conv2d(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,12 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset6.hpp>
#include "conv2d_utils.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -18,4 +18,4 @@ NamedOutputs conv2d_transpose(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -4,11 +4,11 @@
#include "conv2d_utils.hpp"
#include <ngraph/opsets/opset6.hpp>
#include <openvino/opsets/opset6.hpp>
#include "node_context.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -93,4 +93,4 @@ std::shared_ptr<Node> get_reshaped_filter(const Output<Node>& filters, const int
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#pragma once
#include "node_context.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -57,4 +57,4 @@ NamedOutputs conv2d_base(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -34,4 +34,4 @@ NamedOutputs cumsum(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "conv2d_utils.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -64,4 +64,4 @@ NamedOutputs deformable_conv(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -30,4 +30,4 @@ NamedOutputs dropout(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -83,4 +83,4 @@ NamedOutputs elementwise_greater_equal(const NodeContext& node_context) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset8.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset8.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -52,4 +52,4 @@ NamedOutputs embedding(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -17,4 +17,4 @@ NamedOutputs exp(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -50,4 +50,4 @@ NamedOutputs expand_v2(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -38,4 +38,4 @@ NamedOutputs fill_any_like(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset6.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -41,11 +41,11 @@ NamedOutputs fill_constant(const NodeContext& node) {
shape_node = opset6::Constant::create(element::i64, {shape.size()}, shape);
}
return node.default_single_output_mapping({std::make_shared<ngraph::opset6::Broadcast>(value_node, shape_node)},
return node.default_single_output_mapping({std::make_shared<ov::opset6::Broadcast>(value_node, shape_node)},
{"Out"});
}
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -8,7 +8,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -122,4 +122,4 @@ NamedOutputs fill_constant_batch_size_like(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -3,10 +3,10 @@
//
#include <ngraph/builder/reshape.hpp>
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset6.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -44,4 +44,4 @@ NamedOutputs flatten_contiguous_range(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -20,4 +20,4 @@ NamedOutputs gelu(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -24,4 +24,4 @@ NamedOutputs hard_sigmoid(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -30,4 +30,4 @@ NamedOutputs hard_swish(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -175,4 +175,4 @@ NamedOutputs bicubic_interp_v2(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -56,4 +56,4 @@ NamedOutputs layer_norm(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -17,4 +17,4 @@ NamedOutputs leaky_relu(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -17,4 +17,4 @@ NamedOutputs log(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -16,4 +16,4 @@ NamedOutputs logical_not(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -2,13 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
//
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset6.hpp>
#include "ngraph/builder/reshape.hpp"
#include "paddlepaddle_frontend/utility.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -28,7 +28,7 @@ enum class LSTMInput {
struct LSTMNgInputMap {
explicit LSTMNgInputMap(const NodeContext& node, Output<Node>& prev_output, int layer) {
auto input_x = builder::opset1::reorder_axes(prev_output, {1, 0, 2});
auto input_x = ngraph::builder::opset1::reorder_axes(prev_output, {1, 0, 2});
//[begin. end)
auto weight_list = node.get_ng_inputs("WeightList");
auto weight_begin = weight_list.begin();
@ -70,20 +70,20 @@ struct LSTMNgInputMap {
auto hidden_bias = std::make_shared<opset6::Concat>(layer_hidden_bias, 0);
auto bias = std::make_shared<opset6::Add>(weight_bias, hidden_bias);
m_input_map[LSTMInput::LSTM_INPUT_W] =
ngraph::op::util::convert_lstm_node_format(input_weight,
ngraph::op::util::LSTMWeightsFormat::IFCO,
ngraph::op::util::LSTMWeightsFormat::FICO,
1);
ov::op::util::convert_lstm_node_format(input_weight,
ov::op::util::LSTMWeightsFormat::IFCO,
ov::op::util::LSTMWeightsFormat::FICO,
1);
m_input_map[LSTMInput::LSTM_INPUT_R] =
ngraph::op::util::convert_lstm_node_format(hidden_weight,
ngraph::op::util::LSTMWeightsFormat::IFCO,
ngraph::op::util::LSTMWeightsFormat::FICO,
1);
ov::op::util::convert_lstm_node_format(hidden_weight,
ov::op::util::LSTMWeightsFormat::IFCO,
ov::op::util::LSTMWeightsFormat::FICO,
1);
m_input_map[LSTMInput::LSTM_INPUT_B] =
ngraph::op::util::convert_lstm_node_format(bias,
ngraph::op::util::LSTMWeightsFormat::IFCO,
ngraph::op::util::LSTMWeightsFormat::FICO,
1);
ov::op::util::convert_lstm_node_format(bias,
ov::op::util::LSTMWeightsFormat::IFCO,
ov::op::util::LSTMWeightsFormat::FICO,
1);
// Get dimensions needed for default inputs creation
// Parsing init hidden state
@ -115,19 +115,19 @@ struct LSTMNgInputMap {
auto c_end = opset6::Constant::create(element::i64, {1}, {layer * bidirect_len + bidirect_len});
m_input_map[LSTMInput::LSTM_INPUT_INIT_H] =
builder::opset1::reorder_axes(std::make_shared<opset6::StridedSlice>(init_states[0],
h_begin,
h_end,
std::vector<int64_t>{0},
std::vector<int64_t>{0}),
{1, 0, 2});
ngraph::builder::opset1::reorder_axes(std::make_shared<opset6::StridedSlice>(init_states[0],
h_begin,
h_end,
std::vector<int64_t>{0},
std::vector<int64_t>{0}),
{1, 0, 2});
m_input_map[LSTMInput::LSTM_INPUT_INIT_C] =
builder::opset1::reorder_axes(std::make_shared<opset6::StridedSlice>(init_states[1],
c_begin,
c_end,
std::vector<int64_t>{0},
std::vector<int64_t>{0}),
{1, 0, 2});
ngraph::builder::opset1::reorder_axes(std::make_shared<opset6::StridedSlice>(init_states[1],
c_begin,
c_end,
std::vector<int64_t>{0},
std::vector<int64_t>{0}),
{1, 0, 2});
}
Output<ngraph::Node>& at(const LSTMInput& key) {
@ -172,12 +172,12 @@ NamedOutputs lstm(const NodeContext& node) {
input_map.at(LSTMInput::LSTM_INPUT_B),
attrs.m_hidden_size,
attrs.m_direction);
prev_output = builder::opset1::reorder_axes(lstm_sequence->output(0), {2, 0, 1, 3});
prev_output = ngraph::builder::opset1::reorder_axes(lstm_sequence->output(0), {2, 0, 1, 3});
auto out_shape = opset6::Constant::create(element::i64, Shape{3}, {0, 0, -1});
prev_output = std::make_shared<opset6::Reshape>(prev_output, out_shape, true);
final_h.push_back(builder::opset1::reorder_axes(lstm_sequence->output(1), {1, 0, 2}));
final_c.push_back(builder::opset1::reorder_axes(lstm_sequence->output(2), {1, 0, 2}));
final_h.push_back(ngraph::builder::opset1::reorder_axes(lstm_sequence->output(1), {1, 0, 2}));
final_c.push_back(ngraph::builder::opset1::reorder_axes(lstm_sequence->output(2), {1, 0, 2}));
}
NamedOutputs named_outputs;
@ -190,4 +190,4 @@ NamedOutputs lstm(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -4,7 +4,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -27,4 +27,4 @@ NamedOutputs matmul(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -21,4 +21,4 @@ NamedOutputs matmul_v2(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -84,4 +84,4 @@ NamedOutputs matrix_nms(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -66,4 +66,4 @@ NamedOutputs multiclass_nms(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -84,4 +84,4 @@ NamedOutputs pad3d(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -8,7 +8,7 @@
#include <ngraph/opsets/opset8.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -185,4 +185,4 @@ NamedOutputs pool2d(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -16,7 +16,7 @@ NamedOutputs pow(const NodeContext& node) {
if (node.has_ng_input("FactorTensor")) {
factor_node = node.get_ng_input("FactorTensor");
if (factor_node.get_element_type() != dtype)
factor_node = std::make_shared<opset6::Convert>(factor_node, dtype);
factor_node = std::make_shared<ngraph::opset6::Convert>(factor_node, dtype);
} else {
factor_node = ngraph::opset6::Constant::create(dtype, Shape{1}, {node.get_attribute<float>("factor")});
}
@ -27,4 +27,4 @@ NamedOutputs pow(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -8,7 +8,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -109,4 +109,4 @@ NamedOutputs prior_box(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -28,4 +28,4 @@ NamedOutputs range(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -17,4 +17,4 @@ NamedOutputs relu(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -19,4 +19,4 @@ NamedOutputs relu6(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -6,7 +6,7 @@
#include <node_context.hpp>
#include <paddlepaddle_frontend/utility.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -39,4 +39,4 @@ NamedOutputs reshape2(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -7,7 +7,7 @@
#include "paddlepaddle_frontend/utility.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -24,4 +24,4 @@ NamedOutputs rnn(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -3,10 +3,10 @@
//
#include <ngraph/builder/make_constant.hpp>
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
#include <openvino/opsets/opset6.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -25,20 +25,20 @@ NamedOutputs scale(const NodeContext& node) {
scale = std::make_shared<opset6::Convert>(scale_tensor_node, dtype);
} else {
auto scale_val = node.get_attribute<float>("scale");
scale = ngraph::opset6::Constant::create(dtype, Shape{1}, {scale_val});
scale = ov::opset6::Constant::create(dtype, Shape{1}, {scale_val});
}
auto bias_val = node.get_attribute<float>("bias");
bias = ngraph::opset6::Constant::create(dtype, Shape{1}, {bias_val});
bias = ov::opset6::Constant::create(dtype, Shape{1}, {bias_val});
auto bias_after_scale = node.get_attribute<bool>("bias_after_scale");
std::shared_ptr<Node> result_node;
if (!bias_after_scale) {
auto node_add = std::make_shared<ngraph::opset6::Add>(data, bias);
result_node = std::make_shared<ngraph::opset6::Multiply>(node_add, scale);
auto node_add = std::make_shared<ov::opset6::Add>(data, bias);
result_node = std::make_shared<ov::opset6::Multiply>(node_add, scale);
} else {
auto node_multiply = std::make_shared<ngraph::opset6::Multiply>(data, scale);
result_node = std::make_shared<ngraph::opset6::Add>(node_multiply, bias);
auto node_multiply = std::make_shared<ov::opset6::Multiply>(data, scale);
result_node = std::make_shared<ov::opset6::Add>(node_multiply, bias);
}
return node.default_single_output_mapping({result_node}, {"Out"});
@ -47,4 +47,4 @@ NamedOutputs scale(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -18,4 +18,4 @@ NamedOutputs shape(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -17,4 +17,4 @@ NamedOutputs sigmoid(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -8,7 +8,7 @@
#include "default_opset.hpp"
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -88,4 +88,4 @@ NamedOutputs slice(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

View File

@ -5,7 +5,7 @@
#include <ngraph/opsets/opset6.hpp>
#include <node_context.hpp>
namespace ngraph {
namespace ov {
namespace frontend {
namespace pdpd {
namespace op {
@ -22,4 +22,4 @@ NamedOutputs softmax(const NodeContext& node) {
} // namespace op
} // namespace pdpd
} // namespace frontend
} // namespace ngraph
} // namespace ov

Some files were not shown because too many files have changed in this diff Show More