diff --git a/docs/IE_PLUGIN_DG/Doxyfile b/docs/IE_PLUGIN_DG/Doxyfile index 3d66d22b4a2..e2c4baf4d79 100644 --- a/docs/IE_PLUGIN_DG/Doxyfile +++ b/docs/IE_PLUGIN_DG/Doxyfile @@ -844,8 +844,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = generic_ie.hpp \ - function_name.hpp \ +EXCLUDE_PATTERNS = function_name.hpp \ macro_overload.hpp # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names diff --git a/docs/doxygen/ie_plugin_api.config b/docs/doxygen/ie_plugin_api.config index 7f97edbaa27..08a1381fbcd 100644 --- a/docs/doxygen/ie_plugin_api.config +++ b/docs/doxygen/ie_plugin_api.config @@ -38,8 +38,6 @@ FILE_PATTERNS = *.c \ *.hpp \ *.md -EXCLUDE_PATTERNS = generic_ie.hpp - EXCLUDE_SYMBOLS = InferenceEngine::details TAGFILES = "@DOCS_BUILD_DIR@/ie_api.tag=.." \ diff --git a/inference-engine/src/cldnn_engine/cldnn_engine.cpp b/inference-engine/src/cldnn_engine/cldnn_engine.cpp index 33db7d494c2..2a8a2acdd69 100644 --- a/inference-engine/src/cldnn_engine/cldnn_engine.cpp +++ b/inference-engine/src/cldnn_engine/cldnn_engine.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -137,8 +136,6 @@ InferenceEngine::CNNNetwork clDNNEngine::CloneAndTransformNetwork(const Inferenc if (clonedNetwork.getFunction()) { OV_ITT_SCOPED_TASK(itt::domains::CLDNNPlugin, "clDNNEngine::TransformNetwork"); auto nGraphFunc = clonedNetwork.getFunction(); - // Disable shape inference (WA for generic operations) - ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); bool enableInt8; { diff --git a/inference-engine/src/cldnn_engine/cldnn_graph.cpp b/inference-engine/src/cldnn_engine/cldnn_graph.cpp index 340853cf44e..dfa88e4a64b 100644 --- a/inference-engine/src/cldnn_engine/cldnn_graph.cpp +++ b/inference-engine/src/cldnn_engine/cldnn_graph.cpp @@ -25,8 +25,8 @@ #include #include #include -#include "generic_ie.hpp" #include +#include #include "cldnn_itt.h" using namespace InferenceEngine; @@ -464,7 +464,6 @@ InferenceEngine::CNNNetwork CLDNNGraph::GetExecGraphInfoByPrimitivesInfo(std::ve create_ngraph_node(pi); } - ngraph::op::GenericIE::DisableReshape reshape(nodes); auto function = std::make_shared(results, params, "runtime_gpu_graph"); InferenceEngine::CNNNetwork net(function); return net; diff --git a/inference-engine/src/gna_plugin/gna_plugin.cpp b/inference-engine/src/gna_plugin/gna_plugin.cpp index 6e830276e31..1236b695acf 100644 --- a/inference-engine/src/gna_plugin/gna_plugin.cpp +++ b/inference-engine/src/gna_plugin/gna_plugin.cpp @@ -40,7 +40,6 @@ #include #include "gna_graph_patterns.hpp" -#include #include #include #include @@ -682,8 +681,6 @@ void GNAPlugin::LoadNetwork(CNNNetwork & _network) { if (_network.getFunction()) { CNNNetwork clonedNetwork = InferenceEngine::cloneNetwork(_network); const auto& graph = clonedNetwork.getFunction(); - // Disable shape inference (WA for generic operations) - ngraph::op::GenericIE::DisableReshape noReshape(graph); ngraph::pass::Manager manager; manager.register_pass(); // WA: ConvertPriorBox must be executed before the 1st ConstantFolding pass diff --git a/inference-engine/src/inference_engine/cnn_network_ngraph_impl.cpp b/inference-engine/src/inference_engine/cnn_network_ngraph_impl.cpp index 774eed0dd2d..156b9ab3ecc 100644 --- a/inference-engine/src/inference_engine/cnn_network_ngraph_impl.cpp +++ b/inference-engine/src/inference_engine/cnn_network_ngraph_impl.cpp @@ -32,7 +32,6 @@ #include "ie_ngraph_utils.hpp" #include "exec_graph_info.hpp" #include "ie_itt.hpp" -#include "generic_ie.hpp" using namespace std; using namespace InferenceEngine; @@ -44,7 +43,6 @@ static std::shared_ptr copyFunction(const std::shared_ptr CNNNetworkNGraphImpl::cloneFunction(bool const } void CNNNetworkNGraphImpl::reshape() { - // Disable reshape for generic nodes - ::ngraph::op::GenericIE::DisableReshape noReshape(_ngraph_function); reshape({}); } diff --git a/inference-engine/src/inference_engine/generic_ie.cpp b/inference-engine/src/inference_engine/generic_ie.cpp deleted file mode 100644 index b5155013faf..00000000000 --- a/inference-engine/src/inference_engine/generic_ie.cpp +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (C) 2017-2021 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#include "generic_ie.hpp" - -#include - -#include -#include -#include -#include -#include -#include - -#include "blob_factory.hpp" -#include -#include "ngraph/util.hpp" -#include "ngraph/graph_util.hpp" -#include "ngraph/validation_util.hpp" - -constexpr ::ngraph::NodeTypeInfo ngraph::op::GenericIE::type_info; - -void ngraph::op::GenericIE::addExtension(std::shared_ptr func, - const InferenceEngine::IShapeInferExtensionPtr& ext) { - NodeVector nodes; - - for (auto r : func->get_results()) - nodes.emplace_back(r); - for (auto s : func->get_sinks()) - nodes.emplace_back(s); - for (auto param : func->get_parameters()) - nodes.emplace_back(param); - - traverse_nodes(nodes, [&](std::shared_ptr op) { - if (auto generic = std::dynamic_pointer_cast(op)) { - generic->addExtension(ext); - } - if (auto ti = std::dynamic_pointer_cast(op)) { - addExtension(ti->get_body(), ext); - } - }); -} - -void ngraph::op::GenericIE::addExtension(const InferenceEngine::IShapeInferExtensionPtr& ext) { - extensions.emplace_back(ext); -} - -std::vector ngraph::op::GenericIE::getExtensions(std::shared_ptr func) { - for (auto& op : func->get_ops()) { - if (auto generic = std::dynamic_pointer_cast(op)) { - return generic->getExtensions(); - } - } - return {}; -} - -std::vector ngraph::op::GenericIE::getExtensions() { - return extensions; -} - -ngraph::op::GenericIE::GenericIE(const ngraph::OutputVector& inputs, - const std::map& params_, - const std::string type_, const std::vector& outputs_) - : Op(inputs), params(params_), outputs(outputs_), type(type_), initialized(0) { - constructor_validate_and_infer_types(); -} - -std::shared_ptr ngraph::op::GenericIE::clone_with_new_inputs(const ngraph::OutputVector& new_args) const { - auto genNode = std::make_shared(new_args, params, type, outputs); - genNode->extensions = extensions; - genNode->reshape = reshape; - return genNode; -} - -void ngraph::op::GenericIE::validate_and_infer_types() { - // This function returns precision based on existing precision and - // precision that was set in outputs vector - auto get_precision = [this](const size_t index) -> element::Type { - if (index >= get_output_size() || - get_output_element_type(index) == element::dynamic || - get_output_element_type(index) == element::undefined) { - return InferenceEngine::details::convertPrecision(outputs[index].precision); - } - return get_output_element_type(index); - }; - - // Extensions are not loaded when we create nGraph function - // First call: create node - if (initialized < 1) { - if (outputs.size()) - set_output_size(outputs.size()); - for (size_t output_index = 0; output_index < outputs.size(); output_index++) { - set_output_type(output_index, get_precision(output_index), Shape(outputs[output_index].dims)); - } - initialized++; - } else if (reshape) { - THROW_IE_EXCEPTION << "IShapeInferExtension wasn't registered for node " << get_friendly_name() - << " with type " << type; - } -} - -bool ngraph::op::GenericIE::visit_attributes(ngraph::AttributeVisitor& visitor) { - for (const auto& p : params) { - std::string name = p.first; - std::string value = p.second; - visitor.on_attribute(name, value); - } - // This is a way to pass type name to transformations::Serialize() without - // adding plugin_api dependency on transformation library - std::string name = "__generic_ie_type__"; - std::string value = getType(); - visitor.on_attribute(name, value); - return true; -} diff --git a/inference-engine/src/legacy_api/src/cnn_network_impl.cpp b/inference-engine/src/legacy_api/src/cnn_network_impl.cpp index 9ceb2101fd6..69ba2ea25d5 100644 --- a/inference-engine/src/legacy_api/src/cnn_network_impl.cpp +++ b/inference-engine/src/legacy_api/src/cnn_network_impl.cpp @@ -17,7 +17,6 @@ #include #include -#include "generic_ie.hpp" #include "cnn_network_ngraph_impl.hpp" #include #include @@ -94,8 +93,6 @@ CNNNetworkImpl::CNNNetworkImpl(const ICNNNetwork & ngraphImpl) { IE_ASSERT(ngraphImplPtr != nullptr); IE_ASSERT(ngraphImplPtr->getFunction() != nullptr); auto graph = ngraph::clone_function(*ngraphImpl.getFunction()); - // Disable shape inference (WA for generic operations) - ::ngraph::op::GenericIE::DisableReshape noReshape(graph); ::ngraph::pass::Manager manager; manager.register_pass<::ngraph::pass::InitNodeInfo>(); diff --git a/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp b/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp index 676ba35e97e..12d330a48f1 100644 --- a/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp +++ b/inference-engine/src/legacy_api/src/convert_function_to_cnn_network.cpp @@ -39,7 +39,6 @@ #include "legacy/ngraph_ops/rnn_sequence_ie.hpp" #include "legacy/ngraph_ops/lstm_sequence_ie.hpp" #include "legacy/ngraph_ops/gru_sequence_ie.hpp" -#include "generic_ie.hpp" #include "exec_graph_info.hpp" #include "caseless.hpp" @@ -1710,36 +1709,6 @@ InferenceEngine::details::CNNLayerCreator::CNNLayerCreator(const std::shared_ptr return res; }); - addSpecificCreator({"GenericIE"}, [](const std::shared_ptr<::ngraph::Node> &node, - const std::map ¶ms) -> CNNLayerPtr { - auto type = params.at("__generic_ie_type__"); - auto castedLayer = ngraph::as_type_ptr(node); - LayerParams attrs = {node->get_friendly_name(), type, details::convertPrecision(node->get_output_element_type(0))}; - auto res = std::make_shared(attrs); - if (type == "RNNCell") { - res = std::make_shared(attrs); - } - if (type == "GRUCell") { - res = std::make_shared(attrs); - } - - auto weightableLayer = std::dynamic_pointer_cast(res); - for (const auto& param : castedLayer->getParameters()) { - if (param.second.is()) { - res->blobs[param.first] = param.second.as(); - } else if (param.second.is()) { - res->blobs[param.first] = std::const_pointer_cast(param.second.as()); - } else if (param.second.is()) { - res->params[param.first] = param.second.as(); - } - if (weightableLayer && param.first == "weights") - weightableLayer->_weights = res->blobs[param.first]; - if (weightableLayer && param.first == "biases") - weightableLayer->_biases = res->blobs[param.first]; - } - return res; - }); - addSpecificCreator({"ShuffleChannels"}, [](const std::shared_ptr<::ngraph::Node>& node, const std::map& params) -> CNNLayerPtr { LayerParams attrs = {node->get_friendly_name(), "ShuffleChannels", details::convertPrecision(node->get_output_element_type(0))}; diff --git a/inference-engine/src/mkldnn_plugin/mkldnn_graph_dumper.cpp b/inference-engine/src/mkldnn_plugin/mkldnn_graph_dumper.cpp index 543893930d1..c22512cd972 100644 --- a/inference-engine/src/mkldnn_plugin/mkldnn_graph_dumper.cpp +++ b/inference-engine/src/mkldnn_plugin/mkldnn_graph_dumper.cpp @@ -8,8 +8,8 @@ #include #include "exec_graph_info.hpp" #include "mkldnn_debug.h" -#include "generic_ie.hpp" #include +#include "ngraph/ngraph.hpp" #include #include @@ -136,7 +136,6 @@ InferenceEngine::CNNNetwork dump_graph_as_ie_ngraph_net(const MKLDNNGraph &graph holder->add_control_dependency(node); } - ngraph::op::GenericIE::DisableReshape reshape(nodes); auto function = std::make_shared(results, params, graph._name); InferenceEngine::CNNNetwork net(function); return net; diff --git a/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp b/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp index ff619d6ac93..ab02a25060d 100644 --- a/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp +++ b/inference-engine/src/mkldnn_plugin/mkldnn_plugin.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -106,8 +105,6 @@ Engine::~Engine() { static void Transformation(CNNNetwork& clonedNetwork, const Config& conf) { auto nGraphFunc = clonedNetwork.getFunction(); - // Disable shape inference (WA for generic operations) - ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); ngraph::pass::Manager manager; manager.register_pass(); diff --git a/inference-engine/src/plugin_api/generic_ie.hpp b/inference-engine/src/plugin_api/generic_ie.hpp deleted file mode 100644 index 2cb48c99956..00000000000 --- a/inference-engine/src/plugin_api/generic_ie.hpp +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (C) 2018-2020 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -#pragma once - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -namespace InferenceEngine { - -class IShapeInferExtension; -using IShapeInferExtensionPtr = std::shared_ptr; - -} // namespace InferenceEngine - -namespace ngraph { -namespace op { - -/** - * This generic operation is necessary for legacy scenario. - * If user has old shape inference extensions, this node allow to use it for shape inference - */ -class INFERENCE_ENGINE_API_CLASS(GenericIE) : public Op { -public: - struct PortIE { - InferenceEngine::Precision precision; - std::vector dims; - }; - - class DisableReshape { - public: - explicit DisableReshape(std::vector>& ops) { - for (auto& op : ops) { - addOp(op); - } - } - explicit DisableReshape(const std::shared_ptr& graph) { - IE_ASSERT(graph); - - for (auto& op : graph->get_ops()) { - addOp(op); - } - } - - ~DisableReshape() { - for (auto& generic : genericOps) { - generic->doReshape(true); - } - } - - private: - std::vector> genericOps; - - void addOp(std::shared_ptr& op) { - if (auto generic = std::dynamic_pointer_cast(op)) { - generic->doReshape(false); - genericOps.emplace_back(generic); - } - if (auto ti_node = std::dynamic_pointer_cast(op)) { - auto results = ti_node->get_body()->get_results(); - auto ti_params = ti_node->get_body()->get_parameters(); - ngraph::NodeVector nResults, nParams; - for (const auto& res : results) - nResults.emplace_back(res); - for (const auto& param : ti_params) - nParams.emplace_back(param); - ngraph::traverse_nodes(nResults, [&](std::shared_ptr node) { - if (auto genNode = std::dynamic_pointer_cast(node)) { - genNode->doReshape(false); - genericOps.emplace_back(genNode); - } - }, nParams); - } - } - }; - - static constexpr NodeTypeInfo type_info{"GenericIE", 1}; - const NodeTypeInfo& get_type_info() const override { return type_info; } - - /** - * @brief constructor of generic node - * - * @param inputs vector of inputs - * @param params map of parameters (std::string, Blob::Ptr, Blob::CPtr) - * @param type string with original layer type - * @param outputs information about output ports from IR - */ - GenericIE(const OutputVector& inputs, - const std::map& params, - const std::string type, - const std::vector& outputs); - - void validate_and_infer_types() override; - - std::shared_ptr clone_with_new_inputs(const OutputVector& new_args) const override; - - bool visit_attributes(ngraph::AttributeVisitor& visitor) override; - - static void addExtension(std::shared_ptr func, const InferenceEngine::IShapeInferExtensionPtr& ext); - static std::vector getExtensions(std::shared_ptr func); - - const std::string& getType() const { - return type; - } - - const std::map& getParameters() const { - return params; - } - -private: - void doReshape(bool flag) { - reshape = flag; - } - - std::vector extensions; - bool reshape = true; - std::map params; - std::vector outputs; - std::string type; - int initialized; - - void addExtension(const InferenceEngine::IShapeInferExtensionPtr& ext); - std::vector getExtensions(); -}; - -} // namespace op -} // namespace ngraph diff --git a/inference-engine/src/readers/ir_reader/ie_ir_parser.cpp b/inference-engine/src/readers/ir_reader/ie_ir_parser.cpp index c6151ad577e..8fb24e18db0 100644 --- a/inference-engine/src/readers/ir_reader/ie_ir_parser.cpp +++ b/inference-engine/src/readers/ir_reader/ie_ir_parser.cpp @@ -29,7 +29,6 @@ #include "ie_blob_stream.hpp" #include "caseless.hpp" #include -#include "generic_ie.hpp" #include "precision_utils.h" #include "blob_factory.hpp" @@ -350,7 +349,7 @@ void V10Parser::XmlDeserializer::on_adapter(const std::string& name, ngraph::Val } } else { THROW_IE_EXCEPTION << "Error IR reading. Attribute adapter can not be found for " << name - << " parameter"; + << " parameter"; } } @@ -367,8 +366,6 @@ void V10Parser::XmlDeserializer::on_adapter(const std::string& name, ngraph::Val } else { THROW_IE_EXCEPTION << "Error: not recognized adapter name: " << name << "."; } - // Disabled reshape for generic operations in the TI body - ngraph::op::GenericIE::DisableReshape noReshape(ngraph_function); adapter.set(ngraph_function); } @@ -490,7 +487,6 @@ std::shared_ptr V10Parser::XmlDeserializer::parse_function(con OV_ITT_TASK_NEXT(taskChain, "ConstructNgraphFunction"); - ::ngraph::op::GenericIE::DisableReshape noReshape(allNodes); auto function = std::make_shared(result_nodes, sink_nodes, parameter_nodes, GetStrAttr(root, "name", "")); for (const auto& sink : sink_nodes) { if (const auto& assign = std::dynamic_pointer_cast(sink)) { @@ -764,7 +760,7 @@ std::shared_ptr V10Parser::XmlDeserializer::createNode( std::shared_ptr ngraphNode; - // Find registerd opset + // Find registered opset auto opsetIt = opsets.find(params.version); // Try to create operation from loaded opsets @@ -818,52 +814,6 @@ std::shared_ptr V10Parser::XmlDeserializer::createNode( ngraphNode = ngraphNode->clone_with_new_inputs(ngraphNode->input_values()); } - // Create GenericIE operation for backward compatibility - if (!ngraphNode && (params.version == "experimental" || params.version == "extension")) { - // Try to create Generic node for backward compatibility - std::map parameters; - pugi::xml_node dn = node.child("data"); - if (dn) { - for (const auto& attr : dn.attributes()) { - parameters[attr.name()] = std::string(attr.value()); - } - } - - auto blobs = node.child("blobs"); - if (!blobs.empty()) { - size_t length = weights->byteSize(); - - for (pugi::xml_node blob = blobs.first_child(); !blob.empty(); blob = blob.next_sibling()) { - size_t size = GetUInt64Attr(blob, "size", 0); - uint64_t offset = GetUInt64Attr(blob, "offset", 0); - Precision precision(Precision::U8); - const std::string& preStr = GetStrAttr(blob, "precision", ""); - if (!preStr.empty()) - precision = Precision::FromStr(preStr); - if (!size) continue; - if (!length) - THROW_IE_EXCEPTION << "Cannot read network! The model requires weights data! " - << "Bin file cannot be found! Please specify the path to bin file."; - if (static_cast(length) < offset + size) - THROW_IE_EXCEPTION << "Cannot create " << params.type << " layer with name: " << params.name - << ". Layer has incorrect weights!"; - uint8_t* data = weights->cbuffer().as() + offset; - Blob::Ptr wBlob = make_shared_blob({Precision::U8, { size / precision.size() }, C }, data); - - parameters[blob.name()] = wBlob; - } - } - std::vector outputs; - for (const auto& port : params.outputPorts) { - ngraph::op::GenericIE::PortIE iePort; - iePort.dims = port.dims; - iePort.precision = InferenceEngine::details::convertPrecision(port.precision); - outputs.emplace_back(iePort); - } - - ngraphNode = std::make_shared(inputs, parameters, params.type, outputs); - } - if (!ngraphNode) { THROW_IE_EXCEPTION << "Cannot create " << params.type << " layer " << params.name << " id:" << params.layerId << " from unsupported opset: " << params.version; diff --git a/inference-engine/src/readers/ir_reader/ie_ir_parser.hpp b/inference-engine/src/readers/ir_reader/ie_ir_parser.hpp index 3fb46097fb6..cccab9038b8 100644 --- a/inference-engine/src/readers/ir_reader/ie_ir_parser.hpp +++ b/inference-engine/src/readers/ir_reader/ie_ir_parser.hpp @@ -68,7 +68,6 @@ private: struct GenericLayerParams { struct LayerPortData { size_t portId; - // Precision and dimensions are needed only for GenericIE op ngraph::element::Type_t precision; SizeVector dims; std::unordered_set names; diff --git a/inference-engine/src/transformations/include/transformations/serialize.hpp b/inference-engine/src/transformations/include/transformations/serialize.hpp index e5cbc3ee075..12395d7da4e 100644 --- a/inference-engine/src/transformations/include/transformations/serialize.hpp +++ b/inference-engine/src/transformations/include/transformations/serialize.hpp @@ -22,7 +22,6 @@ class TRANSFORMATIONS_API Serialize; * @brief Serialize transformation converts ngraph::Function into IR files * @attention * - dynamic shapes are not supported - * - GenericIE operation type (experimental opset) is not supported * - order of generated layers in xml file is ngraph specific (given by * get_ordered_ops()); MO generates file with different order, but they are * logically equivalent diff --git a/inference-engine/src/transformations/src/transformations/convert_precision.cpp b/inference-engine/src/transformations/src/transformations/convert_precision.cpp index e4b3d83378f..0492bd4a975 100644 --- a/inference-engine/src/transformations/src/transformations/convert_precision.cpp +++ b/inference-engine/src/transformations/src/transformations/convert_precision.cpp @@ -29,7 +29,6 @@ bool fuse_type_to_nms5(std::shared_ptr & node, ngraph::element::Ty bool fuse_type_to_topk(std::shared_ptr & node, ngraph::element::Type to, size_t idx); bool fuse_type_to_nonzero(std::shared_ptr & node, ngraph::element::Type to, size_t idx); bool fuse_type_to_bucketize(std::shared_ptr & node, ngraph::element::Type to, size_t idx); -bool fuse_type_to_generic_ie(std::shared_ptr & node, ngraph::element::Type to, size_t idx); bool extend_select_type(std::shared_ptr & node, ngraph::element::Type to, size_t idx); @@ -91,7 +90,6 @@ bool ngraph::pass::ConvertPrecision::run_on_function(std::shared_ptr}, {opset4::NotEqual::type_info, fuse_type_to_binary_comparision}, {opset4::Greater::type_info, fuse_type_to_binary_comparision}, @@ -282,12 +280,6 @@ bool fuse_type_to_bucketize(std::shared_ptr & node, ngraph::elemen return false; } -bool fuse_type_to_generic_ie(std::shared_ptr & node, ngraph::element::Type to, size_t idx) { - node->set_output_type(idx, to, node->output(idx).get_partial_shape()); - // return false as we do not replace original node - return false; -} - bool fuse_type_to_shapeof_v0(std::shared_ptr & node, ngraph::element::Type to, size_t idx) { if (auto type_relaxed = std::dynamic_pointer_cast(node)) { type_relaxed->set_overridden_output_type(to); diff --git a/inference-engine/src/transformations/src/transformations/serialize.cpp b/inference-engine/src/transformations/src/transformations/serialize.cpp index c14feb751a7..2b97a83f791 100644 --- a/inference-engine/src/transformations/src/transformations/serialize.cpp +++ b/inference-engine/src/transformations/src/transformations/serialize.cpp @@ -267,16 +267,8 @@ public: } void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { - if ((m_node_type_name == "GenericIE") && - (name == "__generic_ie_type__")) { - // __generic_ie_type__ in GenericIE should not be serialized as a - // since it's purpose is to hold name of the layer type - // it is a WA to not introduce dependency on plugin_api library - m_node_type_name = adapter.get(); - } else { - m_xml_node.append_attribute(name.c_str()) - .set_value(adapter.get().c_str()); - } + m_xml_node.append_attribute(name.c_str()) + .set_value(adapter.get().c_str()); } void on_adapter(const std::string& name, ngraph::ValueAccessor& adapter) override { diff --git a/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp b/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp index b757f3bd486..558e4ca9dd7 100644 --- a/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp +++ b/inference-engine/src/vpu/graph_transformer/src/frontend/frontend.cpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -164,8 +163,6 @@ ModelPtr FrontEnd::buildInitialModel(const ie::CNNNetwork& network) { ie::CNNNetwork FrontEnd::convertNetwork(ie::CNNNetwork& network) { auto nGraphFunc = network.getFunction(); - // Disable shape inference (WA for generic operations) - ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); ngraph::pass::Manager manager; manager.register_pass<::ngraph::pass::InitNodeInfo>(); diff --git a/inference-engine/src/vpu/graph_transformer/src/utils/runtime_graph.cpp b/inference-engine/src/vpu/graph_transformer/src/utils/runtime_graph.cpp index cb7f88ff275..1007cde8e62 100644 --- a/inference-engine/src/vpu/graph_transformer/src/utils/runtime_graph.cpp +++ b/inference-engine/src/vpu/graph_transformer/src/utils/runtime_graph.cpp @@ -4,12 +4,11 @@ #include "vpu/utils/runtime_graph.hpp" -#include "generic_ie.hpp" - #include #include #include #include +#include #include #include diff --git a/inference-engine/src/vpu/myriad_plugin/myriad_plugin.cpp b/inference-engine/src/vpu/myriad_plugin/myriad_plugin.cpp index ccffb14539b..7f6d6f5e1bb 100644 --- a/inference-engine/src/vpu/myriad_plugin/myriad_plugin.cpp +++ b/inference-engine/src/vpu/myriad_plugin/myriad_plugin.cpp @@ -21,8 +21,6 @@ #include #include -#include "generic_ie.hpp" - #include "myriad_plugin.h" using namespace InferenceEngine; diff --git a/inference-engine/tests/functional/inference_engine/CMakeLists.txt b/inference-engine/tests/functional/inference_engine/CMakeLists.txt index a2ed13cb63e..fcfd945c5ca 100644 --- a/inference-engine/tests/functional/inference_engine/CMakeLists.txt +++ b/inference-engine/tests/functional/inference_engine/CMakeLists.txt @@ -206,13 +206,11 @@ endif() # ie_headers_compilation_with_custom_flags(TEST_SUFFIX PluginApiCxx17 - HEADERS_TO_SKIP "generic_ie.hpp" CXX_STANDARD 17 PLUGIN_API) if(UNIX) if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") ie_headers_compilation_with_custom_flags(TEST_SUFFIX PluginApiWarningsAreErrors - HEADERS_TO_SKIP "generic_ie.hpp" FLAGS "-Werror-all -Werror -Wall" PLUGIN_API) else() diff --git a/inference-engine/tests/functional/inference_engine/cnn_network/cnn_ngraph_impl_tests.cpp b/inference-engine/tests/functional/inference_engine/cnn_network/cnn_ngraph_impl_tests.cpp index 6480bd219d2..7f85e8abcb8 100644 --- a/inference-engine/tests/functional/inference_engine/cnn_network/cnn_ngraph_impl_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/cnn_network/cnn_ngraph_impl_tests.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -1438,8 +1437,6 @@ TEST(CNNNGraphImplTests, SaveOriginalResultNameForMultiOutputOp) { } auto nGraphFunc = network.getFunction(); - // Disable shape inference (WA for generic operations) - ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); ngraph::pass::Manager manager; @@ -1630,8 +1627,6 @@ TEST(CNNNGraphImplTests, SaveOriginalResultNameForMultiOutputOpOpset6) { } auto nGraphFunc = network.getFunction(); - // Disable shape inference (WA for generic operations) - ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); ngraph::pass::Manager manager; diff --git a/inference-engine/tests/functional/inference_engine/keep_constant_inputs_tests.cpp b/inference-engine/tests/functional/inference_engine/keep_constant_inputs_tests.cpp index ca0399088ce..54c8391fe79 100644 --- a/inference-engine/tests/functional/inference_engine/keep_constant_inputs_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/keep_constant_inputs_tests.cpp @@ -20,7 +20,6 @@ #include #include #include -#include "generic_ie.hpp" #include "shared_test_classes/base/low_precision_transformations/layer_transformation.hpp" using namespace testing; diff --git a/inference-engine/tests/functional/inference_engine/net_reader_test.cpp b/inference-engine/tests/functional/inference_engine/net_reader_test.cpp index 017c0a69de6..6c4cb650ed8 100644 --- a/inference-engine/tests/functional/inference_engine/net_reader_test.cpp +++ b/inference-engine/tests/functional/inference_engine/net_reader_test.cpp @@ -167,7 +167,7 @@ TEST(NetReaderTest, IRSupportModelDetection) { - + 1 diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp index 6be17382380..2068296fc61 100644 --- a/inference-engine/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/ngraph_reader/non_max_suppression_tests.cpp @@ -17,7 +17,6 @@ #include #include "common_test_utils/ngraph_test_utils.hpp" -#include "generic_ie.hpp" #include "legacy/convert_function_to_cnn_network.hpp" diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp index 958cdd46e1b..ef47afe343a 100644 --- a/inference-engine/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/ngraph_reader/proposal_tests.cpp @@ -3,7 +3,6 @@ // #include -#include #include "ngraph/opsets/opset6.hpp" #include "ngraph_reader_tests.hpp" TEST_F(NGraphReaderTests, ReadProposalNetwork) { @@ -405,4 +404,4 @@ TEST_F(NGraphReaderTests, ReadExtensionProposalNetwork) { } } FAIL() << "Custom proposal layer is not an opset6 operation."; -} \ No newline at end of file +} diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp index 3ec3d1ada77..2c4a0b5c006 100644 --- a/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp +++ b/inference-engine/tests/functional/inference_engine/ngraph_reshape_tests.cpp @@ -30,7 +30,6 @@ #include "common_test_utils/data_utils.hpp" #include "common_test_utils/file_utils.hpp" #include "common_test_utils/common_utils.hpp" -#include "generic_ie.hpp" IE_SUPPRESS_DEPRECATED_START diff --git a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp index bcdda383cf0..eb99a23efc8 100644 --- a/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp +++ b/inference-engine/tests/functional/plugin/cpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp @@ -10,7 +10,6 @@ #include #include -#include "generic_ie.hpp" #include #include @@ -79,8 +78,6 @@ InferenceEngine::CNNNetwork convert(std::shared_ptr function) std::dynamic_pointer_cast(node); }; auto nGraphFunc = clonedNetwork.getFunction(); - // Disable shape inference (WA for generic operations) - ::ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); // Note: instead of running all Conversion Transformations you can make up your own transformation pipeline ngraph::pass::Manager manager; diff --git a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp index 264a0707fec..643cf3c33b7 100644 --- a/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp +++ b/inference-engine/tests/functional/plugin/gpu/shared_tests_instances/low_precision_transformations/layer_transformation.cpp @@ -10,7 +10,6 @@ #include #include -#include "generic_ie.hpp" #include #include @@ -112,8 +111,6 @@ InferenceEngine::CNNNetwork convert(std::shared_ptr function) std::dynamic_pointer_cast(node); }; auto nGraphFunc = clonedNetwork.getFunction(); - // Disable shape inference (WA for generic operations) - ::ngraph::op::GenericIE::DisableReshape noReshape(nGraphFunc); // Note: instead of running all Conversion Transformations you can make up your own transformation pipeline ngraph::pass::Manager manager; diff --git a/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp b/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp index 2c456ef9c42..0adcc944d7a 100644 --- a/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp +++ b/inference-engine/tests_deprecated/functional/mkldnn/extensions_tests/extensions_test.cpp @@ -23,55 +23,6 @@ struct extension_params { std::map config; }; -class FakePrimitiveImpl : public InferenceEngine::ILayerExecImpl { -public: - FakePrimitiveImpl(const InferenceEngine::CNNLayer *layer) { - cnnLayer = const_cast(layer); - } - InferenceEngine::StatusCode getSupportedConfigurations(std::vector& conf, InferenceEngine::ResponseDesc *resp) noexcept override { - InferenceEngine::LayerConfig config; - config.dynBatchSupport = true; - if (cnnLayer->outData.size() != 1 && cnnLayer->insData.size() != 1) - return InferenceEngine::GENERAL_ERROR; - InferenceEngine::DataConfig cfg; - cfg.constant = false; - cfg.inPlace = 0; - InferenceEngine::SizeVector order; - for(size_t i = 0; i < cnnLayer->outData[0]->getTensorDesc().getDims().size(); i++) { - order.push_back(i); - } - cfg.desc = InferenceEngine::TensorDesc(cnnLayer->outData[0]->getTensorDesc().getPrecision(), - cnnLayer->outData[0]->getTensorDesc().getDims(), - {cnnLayer->outData[0]->getTensorDesc().getDims(), order}); - config.outConfs.push_back(cfg); - config.inConfs.push_back(cfg); - conf.push_back(config); - return InferenceEngine::OK; - } - InferenceEngine::StatusCode init(InferenceEngine::LayerConfig& config, InferenceEngine::ResponseDesc *resp) noexcept override { - return InferenceEngine::OK; - } - InferenceEngine::StatusCode execute(std::vector& inputs, std::vector& outputs, InferenceEngine::ResponseDesc *resp) noexcept override { - return InferenceEngine::OK; - } - -private: - InferenceEngine::CNNLayer* cnnLayer; -}; - -class TestExtension : public InferenceEngine::IExtension { -public: - void Release() noexcept override { delete this; } - - void GetVersion(const InferenceEngine::Version *&versionInfo) const noexcept override - { - static const InferenceEngine::Version VERSION{{}, "", ""}; - versionInfo = &VERSION; - } - - void Unload() noexcept override {} -}; - class NewFakePrimitiveImpl : public InferenceEngine::ILayerExecImpl { public: NewFakePrimitiveImpl(const std::shared_ptr& node): node(node) {} @@ -179,7 +130,7 @@ public: if (opsets.empty()) { ngraph::OpSet opset; opset.insert(); - opsets["experimental"] = opset; + opsets["custom_opset"] = opset; } return opsets; } @@ -213,7 +164,7 @@ protected: std::unique_ptr score_engine1; score_engine1.reset(new InferenceEnginePluginPtr(make_plugin_name(p.plugin()).c_str())); (*score_engine1)->SetConfig(p.config); - + std::unique_ptr score_engine2; score_engine2.reset(new InferenceEnginePluginPtr(make_plugin_name(p.plugin()).c_str())); (*score_engine2)->SetConfig(p.config); @@ -248,7 +199,7 @@ protected: - + 1 @@ -291,20 +242,14 @@ protected: Blob::Ptr weights; CNNNetwork cnnNet1 = ie.ReadNetwork(model, weights); - CNNNetwork cnnNet2 = ie2.ReadNetwork(model, weights); ASSERT_NO_THROW(ie.LoadNetwork(cnnNet1, device)); - ASSERT_THROW(ie2.LoadNetwork(cnnNet2, device), details::InferenceEngineException); + ASSERT_THROW(ie2.ReadNetwork(model, weights), details::InferenceEngineException); } catch (const InferenceEngine::details::InferenceEngineException& e) { FAIL() << e.what(); } } }; -/************************************************* - * !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! - * All ref values was obtained from Caffe scoring - * !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! !!! - *************************************************/ #ifndef ENABLE_MKL_DNN #include "disable_tests.hpp" #endif