forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated common migration pipeline (openvinotoolkit#8176)
* Updated common migration pipeline * Fixed merge issue * Added new model and extended example * Fixed typo * Added v10-v11 comparison
- Loading branch information
Showing
8 changed files
with
313 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# OpenVINO™ graph construction {#ov_graph_construction} | ||
|
||
OpenVINO™ 2.0 includes nGraph engine in a common part. The `ngraph` namespace was changed to `ov`. | ||
Code snippets below show how application code should be changed for migration to OpenVINO™ 2.0. | ||
|
||
nGraph API: | ||
|
||
@snippet snippets/ngraph.cpp ngraph:graph | ||
|
||
OpenVINO™ 2.0 API: | ||
|
||
@snippet snippets/ov_graph.cpp ov:graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (C) 2018-2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include <ngraph/ngraph.hpp> | ||
#include <ngraph/opsets/opset8.hpp> | ||
|
||
int main() { | ||
//! [ngraph:graph] | ||
// _____________ _____________ | ||
// | Parameter | | Parameter | | ||
// | data1 | | data2 | | ||
// |___________| |___________| | ||
// | | | ||
// data1_t | | data2_t | ||
// \ / | ||
// \ / | ||
// \ / | ||
// ____\____/____ | ||
// | Concat | | ||
// | concat | | ||
// |____________| | ||
// | | ||
// | concat_t | ||
// | | ||
// _______|_______ | ||
// | Result | | ||
// | result | | ||
// |_____________| | ||
auto data1 = std::make_shared<ngraph::opset8::Parameter>(ngraph::element::i64, ngraph::Shape{1, 3, 2, 2}); | ||
data1->set_friendly_name("data1"); // operation name | ||
data1->output(0).set_names({"data1_t"}); // tensor names | ||
auto data2 = std::make_shared<ngraph::opset8::Parameter>(ngraph::element::i64, ngraph::Shape{1, 2, 2, 2}); | ||
data2->set_friendly_name("data2"); // operation name | ||
data2->output(0).set_names({"data2_t"}); // tensor names | ||
|
||
auto concat = std::make_shared<ngraph::opset8::Concat>(ngraph::OutputVector{data1, data2}, 1); | ||
concat->set_friendly_name("concat"); // operation name | ||
concat->output(0).set_names({"concat_t"}); // tensor name | ||
|
||
auto result = std::make_shared<ngraph::opset8::Result>(concat); | ||
result->set_friendly_name("result"); // operation name | ||
|
||
auto f = std::make_shared<ngraph::Function>(ngraph::ResultVector{result}, | ||
ngraph::ParameterVector{data1, data2}, | ||
"function_name"); | ||
//! [ngraph:graph] | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (C) 2018-2021 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
#include <openvino/core/core.hpp> | ||
#include <openvino/opsets/opset8.hpp> | ||
|
||
int main() { | ||
//! [ov:graph] | ||
// _____________ _____________ | ||
// | Parameter | | Parameter | | ||
// | data1 | | data2 | | ||
// |___________| |___________| | ||
// | | | ||
// data1_t | | data2_t | ||
// \ / | ||
// \ / | ||
// \ / | ||
// ____\____/____ | ||
// | Concat | | ||
// | concat | | ||
// |____________| | ||
// | | ||
// | concat_t | ||
// | | ||
// _______|_______ | ||
// | Result | | ||
// | result | | ||
// |_____________| | ||
auto data1 = std::make_shared<ov::opset8::Parameter>(ov::element::i64, ov::Shape{1, 3, 2, 2}); | ||
data1->set_friendly_name("data1"); // operation name | ||
data1->output(0).set_names({"data1_t"}); // tensor names | ||
auto data2 = std::make_shared<ov::opset8::Parameter>(ov::element::i64, ov::Shape{1, 2, 2, 2}); | ||
data2->set_friendly_name("data2"); // operation name | ||
data2->output(0).set_names({"data2_t"}); // tensor names | ||
|
||
auto concat = std::make_shared<ov::opset8::Concat>(ov::OutputVector{data1, data2}, 1); | ||
concat->set_friendly_name("concat"); // operation name | ||
concat->output(0).set_names({"concat_t"}); // tensor name | ||
|
||
auto result = std::make_shared<ov::opset8::Result>(concat); | ||
result->set_friendly_name("result"); // operation name | ||
|
||
auto f = | ||
std::make_shared<ov::Function>(ov::ResultVector{result}, ov::ParameterVector{data1, data2}, "function_name"); | ||
//! [ov:graph] | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters