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.
* snippets CPU 1/6 * snippets CPU 2/6 * snippets CPU 3/6 * snippets CPU 4/6 * snippets CPU 5/6 * snippets CPU 6/6 * make module TODO: REMEMBER ABOUT EXPORTING PYTONPATH ON CIs ETC * Add static model creation in snippets for CPU
- Loading branch information
Showing
8 changed files
with
77 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from .utils import get_image | ||
from .utils import get_model | ||
from .utils import get_ngraph_model |
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,2 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from snippets import get_model | ||
|
||
model = get_model() | ||
|
||
#! [compile_model_default] | ||
from openvino.runtime import Core | ||
import openvino as ov | ||
|
||
core = Core() | ||
model = core.read_model("model.xml") | ||
core = ov.Core() | ||
compiled_model = core.compile_model(model, "CPU") | ||
#! [compile_model_default] | ||
|
||
#! [compile_model_multi] | ||
core = Core() | ||
model = core.read_model("model.xml") | ||
core = ov.Core() | ||
compiled_model = core.compile_model(model, "MULTI:CPU,GPU.0") | ||
#! [compile_model_multi] |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from snippets import get_model | ||
|
||
from openvino.runtime import Core | ||
model = get_model() | ||
|
||
#! [static_shape] | ||
core = Core() | ||
model = core.read_model("model.xml") | ||
import openvino as ov | ||
|
||
core = ov.Core() | ||
model.reshape([10, 20, 30, 40]) | ||
#! [static_shape] |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
# Copyright (C) 2023 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from openvino.runtime import Core | ||
|
||
#! [ov:execution_mode:part0] | ||
core = Core() | ||
import openvino as ov | ||
|
||
core = ov.Core() | ||
# in case of Accuracy | ||
core.set_property("CPU", {"EXECUTION_MODE_HINT": "ACCURACY"}) | ||
core.set_property( | ||
"CPU", | ||
{ov.properties.hint.execution_mode(): ov.properties.hint.ExecutionMode.ACCURACY}, | ||
) | ||
# in case of Performance | ||
core.set_property("CPU", {"EXECUTION_MODE_HINT": "PERFORMANCE"}) | ||
core.set_property( | ||
"CPU", | ||
{ov.properties.hint.execution_mode(): ov.properties.hint.ExecutionMode.PERFORMANCE}, | ||
) | ||
#! [ov:execution_mode:part0] |
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