Merge branch 'master' into github_actions/tests_parallel
This commit is contained in:
commit
da7cbe566c
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -93,6 +93,7 @@
|
||||
/tests/layer_tests/pytorch_tests/ @openvinotoolkit/openvino-pytorch-frontend-maintainers
|
||||
/tests/layer_tests/tensorflow_tests @openvinotoolkit/openvino-tf-frontend-maintainers
|
||||
/tests/layer_tests/jax_tests @openvinotoolkit/openvino-tf-frontend-maintainers
|
||||
/tests/model_hub_tests @openvinotoolkit/openvino-tf-frontend-maintainers
|
||||
|
||||
# Tools:
|
||||
/tools/ @openvinotoolkit/openvino-tools-maintainers
|
||||
|
23
.github/workflows/linux.yml
vendored
23
.github/workflows/linux.yml
vendored
@ -41,6 +41,7 @@ jobs:
|
||||
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
|
||||
SAMPLES_INSTALL_DIR: ${{ github.workspace }}/install/samples
|
||||
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests
|
||||
MODEL_HUB_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/model_hub_tests
|
||||
BUILD_DIR: ${{ github.workspace }}/build
|
||||
DATA_PATH: ${{ github.workspace }}/testdata
|
||||
MODELS_PATH: ${{ github.workspace }}/testdata
|
||||
@ -183,15 +184,24 @@ jobs:
|
||||
- name: Cmake Layer Tests
|
||||
run: cmake -GNinja -S ${{ env.OPENVINO_REPO }}/tests/layer_tests -B ${{ env.BUILD_DIR }}/layer_tests
|
||||
|
||||
- name: Cmake Model Hub Tests
|
||||
run: cmake -GNinja -S ${{ env.OPENVINO_REPO }}/tests/model_hub_tests -B ${{ env.BUILD_DIR }}/model_hub_tests
|
||||
|
||||
- name: Build Layer Tests
|
||||
run: cmake --build ${{ env.BUILD_DIR }}/layer_tests --parallel --config Release
|
||||
|
||||
- name: Build Model Hub Tests
|
||||
run: cmake --build ${{ env.BUILD_DIR }}/model_hub_tests --parallel --config Release
|
||||
|
||||
- name: Install wheel packages
|
||||
run: cmake -DCOMPONENT=python_wheels -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
|
||||
|
||||
- name: Install Layer Tests
|
||||
run: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/layer_tests/cmake_install.cmake
|
||||
|
||||
- name: Install Model Hub Tests
|
||||
run: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/model_hub_tests/cmake_install.cmake
|
||||
|
||||
- name: Install python wheels
|
||||
run: python3 -m pip install openvino-dev --find-links=${{ env.INSTALL_DIR }}/tools
|
||||
|
||||
@ -482,6 +492,7 @@ jobs:
|
||||
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
|
||||
SAMPLES_INSTALL_DIR: ${{ github.workspace }}/install/samples
|
||||
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests
|
||||
MODEL_HUB_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/model_hub_tests
|
||||
BUILD_DIR: ${{ github.workspace }}/build
|
||||
DATA_PATH: ${{ github.workspace }}/testdata
|
||||
MODELS_PATH: ${{ github.workspace }}/testdata
|
||||
@ -655,6 +666,18 @@ jobs:
|
||||
env:
|
||||
TEST_DEVICE: CPU
|
||||
|
||||
- name: TensorFlow Hub Tests - TF FE
|
||||
run: |
|
||||
python3 -m pip install -r ${{ env.MODEL_HUB_TESTS_INSTALL_DIR }}/tf_hub_tests/requirements.txt
|
||||
|
||||
export PYTHONPATH=${{ env.MODEL_HUB_TESTS_INSTALL_DIR }}:$PYTHONPATH
|
||||
|
||||
source ${{ env.INSTALL_DIR }}/setupvars.sh
|
||||
|
||||
python3 -m pytest ${{ env.MODEL_HUB_TESTS_INSTALL_DIR }}/tf_hub_tests/ -m precommit --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-tf_hub_tf_fe.xml
|
||||
env:
|
||||
TEST_DEVICE: CPU
|
||||
|
||||
- name: TensorFlow 1 Layer Tests - Legacy FE
|
||||
run: |
|
||||
python3 -m pip install -r ${{ env.LAYER_TESTS_INSTALL_DIR }}/requirements.txt
|
||||
|
@ -3,7 +3,8 @@
|
||||
@sphinxdirective
|
||||
|
||||
.. meta::
|
||||
:description: Preparing models for OpenVINO Runtime. Learn how to convert and compile models from different frameworks or read them directly.
|
||||
:description: Preparing models for OpenVINO Runtime. Learn about the methods
|
||||
used to read, convert and compile models from different frameworks.
|
||||
|
||||
|
||||
.. toctree::
|
||||
@ -17,39 +18,43 @@
|
||||
|
||||
Every deep learning workflow begins with obtaining a model. You can choose to prepare a custom one, use a ready-made solution and adjust it to your needs, or even download and run a pre-trained network from an online database, such as `TensorFlow Hub <https://tfhub.dev/>`__, `Hugging Face <https://huggingface.co/>`__, `Torchvision models <https://pytorch.org/hub/>`__.
|
||||
|
||||
:doc:`OpenVINO™ supports several model formats <Supported_Model_Formats>` and allows converting them to it's own, `openvino.runtime.Model <api/ie_python_api/_autosummary/openvino.runtime.Model.html>`__ (`ov.Model <api/ie_python_api/_autosummary/openvino.runtime.Model.html>`__ ), providing a tool dedicated to this task.
|
||||
Import a model using ``read_model()``
|
||||
#################################################
|
||||
|
||||
There are several options to convert a model from original framework to OpenVINO model format (``ov.Model``).
|
||||
Model files (not Python objects) from :doc:`ONNX, PaddlePaddle, TensorFlow and TensorFlow Lite <Supported_Model_Formats>` (check :doc:`TensorFlow Frontend Capabilities and Limitations <openvino_docs_MO_DG_TensorFlow_Frontend>`) do not require a separate step for model conversion, that is ``mo.convert_model``.
|
||||
|
||||
The ``read_model()`` method reads a model from a file and produces ``ov.Model``. If the file is in one of the supported original framework file formats, it is converted automatically to OpenVINO Intermediate Representation. If the file is already in the OpenVINO IR format, it is read "as-is", without any conversion involved. ``ov.Model`` can be serialized to IR using the ``ov.serialize()`` method. The serialized IR can be further optimized using :doc:`Neural Network Compression Framework (NNCF) <ptq_introduction>` that applies post-training quantization methods.
|
||||
The ``read_model()`` method reads a model from a file and produces `openvino.runtime.Model <api/ie_python_api/_autosummary/openvino.runtime.Model.html>`__. If the file is in one of the supported original framework file :doc:`formats <Supported_Model_Formats>`, the method runs internal conversion to an OpenVINO model format. If the file is already in the :doc:`OpenVINO IR format <openvino_ir>`, it is read "as-is", without any conversion involved.
|
||||
|
||||
Convert a model in Python
|
||||
######################################
|
||||
You can also convert a model from original framework to `openvino.runtime.Model <api/ie_python_api/_autosummary/openvino.runtime.Model.html>`__ using ``convert_model()`` method. More details about ``convert_model()`` are provided in :doc:`model conversion guide <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` .
|
||||
|
||||
Model conversion API, specifically, the ``mo.convert_model()`` method converts a model from original framework to ``ov.Model``. ``mo.convert_model()`` returns ``ov.Model`` object in memory so the ``read_model()`` method is not required. The resulting ``ov.Model`` can be inferred in the same training environment (python script or Jupiter Notebook). ``mo.convert_model()`` provides a convenient way to quickly switch from framework-based code to OpenVINO-based code in your inference application. In addition to model files, ``mo.convert_model()`` can take OpenVINO extension objects constructed directly in Python for easier conversion of operations that are not supported in OpenVINO. The ``mo.convert_model()`` method also has a set of parameters to :doc:`cut the model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>`, :doc:`set input shapes or layout <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>`, :doc:`add preprocessing <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>`, etc.
|
||||
``ov.Model`` can be saved to IR using the ``ov.save_model()`` method. The saved IR can be further optimized using :doc:`Neural Network Compression Framework (NNCF) <ptq_introduction>` that applies post-training quantization methods.
|
||||
|
||||
.. image:: _static/images/model_conversion_diagram.svg
|
||||
:alt: model conversion diagram
|
||||
.. note::
|
||||
|
||||
Convert a model with ``mo`` command-line tool
|
||||
#############################################
|
||||
``convert_model()`` also allows you to perform input/output cut, add pre-processing or add custom Python conversion extensions.
|
||||
|
||||
Another option to convert a model is to use ``mo`` command-line tool. ``mo`` is a cross-platform tool that facilitates the transition between training and deployment environments, performs static model analysis, and adjusts deep learning models for optimal execution on end-point target devices in the same measure, as the ``mo.convert_model`` method.
|
||||
Convert a model with Python using ``mo.convert_model()``
|
||||
###########################################################
|
||||
|
||||
``mo`` requires the use of a pre-trained deep learning model in one of the supported formats: TensorFlow, TensorFlow Lite, PaddlePaddle, or ONNX. ``mo`` converts the model to the OpenVINO Intermediate Representation format (IR), which needs to be read with the ``ov.read_model()`` method. Then, you can compile and infer the ``ov.Model`` later with :doc:`OpenVINO™ Runtime <openvino_docs_OV_UG_OV_Runtime_User_Guide>`.
|
||||
Model conversion API, specifically, the ``mo.convert_model()`` method converts a model from original framework to ``ov.Model``. ``mo.convert_model()`` returns ``ov.Model`` object in memory so the ``read_model()`` method is not required. The resulting ``ov.Model`` can be inferred in the same training environment (python script or Jupiter Notebook). ``mo.convert_model()`` provides a convenient way to quickly switch from framework-based code to OpenVINO-based code in your inference application.
|
||||
|
||||
In addition to model files, ``mo.convert_model()`` can take OpenVINO extension objects constructed directly in Python for easier conversion of operations that are not supported in OpenVINO. The ``mo.convert_model()`` method also has a set of parameters to :doc:`cut the model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>`, :doc:`set input shapes or layout <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>`, :doc:`add preprocessing <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>`, etc.
|
||||
|
||||
The figure below illustrates the typical workflow for deploying a trained deep learning model:
|
||||
|
||||
.. image:: _static/images/BASIC_FLOW_MO_simplified.svg
|
||||
|
||||
where IR is a pair of files describing the model:
|
||||
The figure below illustrates the typical workflow for deploying a trained deep learning model, where IR is a pair of files describing the model:
|
||||
|
||||
* ``.xml`` - Describes the network topology.
|
||||
* ``.bin`` - Contains the weights and biases binary data.
|
||||
|
||||
.. image:: _static/images/model_conversion_diagram.svg
|
||||
:alt: model conversion diagram
|
||||
|
||||
Model files (not Python objects) from ONNX, PaddlePaddle, TensorFlow and TensorFlow Lite (check :doc:`TensorFlow Frontend Capabilities and Limitations <openvino_docs_MO_DG_TensorFlow_Frontend>`) do not require a separate step for model conversion, that is ``mo.convert_model``. OpenVINO provides C++ and Python APIs for importing the models to OpenVINO Runtime directly by just calling the ``read_model`` method.
|
||||
|
||||
Convert a model using ``mo`` command-line tool
|
||||
#################################################
|
||||
|
||||
Another option to convert a model is to use ``mo`` command-line tool. ``mo`` is a cross-platform tool that facilitates the transition between training and deployment environments, performs static model analysis, and adjusts deep learning models for optimal execution on end-point target devices in the same measure, as the ``mo.convert_model()`` method.
|
||||
|
||||
``mo`` requires the use of a pre-trained deep learning model in one of the supported formats: TensorFlow, TensorFlow Lite, PaddlePaddle, or ONNX. ``mo`` converts the model to the OpenVINO Intermediate Representation format (IR), which needs to be read with the ``ov.read_model()`` method. Then, you can compile and infer the ``ov.Model`` later with :doc:`OpenVINO™ Runtime <openvino_docs_OV_UG_OV_Runtime_User_Guide>`.
|
||||
|
||||
The results of both ``mo`` and ``mo.convert_model()`` conversion methods described above are the same. You can choose one of them, depending on what is most convenient for you. Keep in mind that there should not be any differences in the results of model conversion if the same set of parameters is used.
|
||||
|
||||
|
@ -44,18 +44,21 @@ To convert a model to OpenVINO model format (``ov.Model``), you can use the foll
|
||||
|
||||
If the out-of-the-box conversion (only the ``input_model`` parameter is specified) is not successful, use the parameters mentioned below to override input shapes and cut the model:
|
||||
|
||||
- model conversion API provides two parameters to override original input shapes for model conversion: ``input`` and ``input_shape``.
|
||||
For more information about these parameters, refer to the :doc:`Setting Input Shapes <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
- ``input`` and ``input_shape`` - the model conversion API parameters used to override original input shapes for model conversion,
|
||||
|
||||
For more information about the parameters, refer to the :doc:`Setting Input Shapes <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
|
||||
- ``input`` and ``output`` - the model conversion API parameters used to define new inputs and outputs of the converted model to cut off unwanted parts (such as unsupported operations and training sub-graphs),
|
||||
|
||||
- To cut off unwanted parts of a model (such as unsupported operations and training sub-graphs),
|
||||
use the ``input`` and ``output`` parameters to define new inputs and outputs of the converted model.
|
||||
For a more detailed description, refer to the :doc:`Cutting Off Parts of a Model <openvino_docs_MO_DG_prepare_model_convert_model_Cutting_Model>` guide.
|
||||
|
||||
You can also insert additional input pre-processing sub-graphs into the converted model by using
|
||||
the ``mean_values``, ``scales_values``, ``layout``, and other parameters described
|
||||
in the :doc:`Embedding Preprocessing Computation <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` article.
|
||||
- ``mean_values``, ``scales_values``, ``layout`` - the parameters used to insert additional input pre-processing sub-graphs into the converted model,
|
||||
|
||||
The ``compress_to_fp16`` compression parameter in ``mo`` command-line tool allows generating IR with constants (for example, weights for convolutions and matrix multiplications) compressed to ``FP16`` data type. For more details, refer to the :doc:`Compression of a Model to FP16 <openvino_docs_MO_DG_FP16_Compression>` guide.
|
||||
For more details, see the :doc:`Embedding Preprocessing Computation <openvino_docs_MO_DG_Additional_Optimization_Use_Cases>` article.
|
||||
|
||||
- ``compress_to_fp16`` - a compression parameter in ``mo`` command-line tool, which allows generating IR with constants (for example, weights for convolutions and matrix multiplications) compressed to ``FP16`` data type.
|
||||
|
||||
For more details, refer to the :doc:`Compression of a Model to FP16 <openvino_docs_MO_DG_FP16_Compression>` guide.
|
||||
|
||||
To get the full list of conversion parameters, run the following command:
|
||||
|
||||
|
@ -19,7 +19,7 @@ Example of converting a PyTorch model directly from memory:
|
||||
:force:
|
||||
|
||||
import torchvision
|
||||
|
||||
|
||||
model = torchvision.models.resnet50(pretrained=True)
|
||||
ov_model = convert_model(model)
|
||||
|
||||
@ -36,7 +36,7 @@ Example of using native Python classes to set ``input_shape``, ``mean_values`` a
|
||||
:force:
|
||||
|
||||
from openvino.runtime import PartialShape, Layout
|
||||
|
||||
|
||||
ov_model = convert_model(model, input_shape=PartialShape([1,3,100,100]), mean_values=[127, 127, 127], layout=Layout("NCHW"))
|
||||
|
||||
Example of using strings for setting ``input_shape``, ``mean_values`` and ``layout``:
|
||||
@ -74,7 +74,7 @@ Example of using ``InputCutInfo`` to freeze an input with value:
|
||||
:force:
|
||||
|
||||
from openvino.tools.mo import convert_model, InputCutInfo
|
||||
|
||||
|
||||
ov_model = convert_model(model, input=InputCutInfo("input_name", [3], np.float32, [0.5, 2.1, 3.4]))
|
||||
|
||||
To set parameters for models with multiple inputs, use ``list`` of parameters.
|
||||
@ -104,7 +104,7 @@ Example of using the ``Layout`` class to set the layout of a model input:
|
||||
|
||||
from openvino.runtime import Layout
|
||||
from openvino.tools.mo import convert_model
|
||||
|
||||
|
||||
ov_model = convert_model(model, source_layout=Layout("NCHW"))
|
||||
|
||||
To set both source and destination layouts in the ``layout`` parameter, use the ``LayoutMap`` class. ``LayoutMap`` accepts two parameters: ``source_layout`` and ``target_layout``.
|
||||
@ -117,7 +117,7 @@ Example of using the ``LayoutMap`` class to change the layout of a model input:
|
||||
:force:
|
||||
|
||||
from openvino.tools.mo import convert_model, LayoutMap
|
||||
|
||||
|
||||
ov_model = convert_model(model, layout=LayoutMap("NCHW", "NHWC"))
|
||||
|
||||
@endsphinxdirective
|
||||
@endsphinxdirective
|
@ -21,11 +21,32 @@ This page provides instructions on model conversion from the ONNX format to the
|
||||
|
||||
Model conversion process assumes you have an ONNX model that was directly downloaded from a public repository or converted from any framework that supports exporting to the ONNX format.
|
||||
|
||||
To convert an ONNX model, run model conversion with the path to the input model ``.onnx`` file:
|
||||
.. tab-set::
|
||||
|
||||
.. code-block:: sh
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
To convert an ONNX model, run ``convert_model()`` method with the path to the ``<INPUT_MODEL>.onnx`` file:
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = convert_model("<INPUT_MODEL>.onnx")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
.. important::
|
||||
|
||||
The ``convert_model()`` method returns ``ov.Model`` that you can optimize, compile, or save to a file for subsequent use.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
||||
You can use ``mo`` command-line tool to convert a model to IR. The obtained IR can then be read by ``read_model()`` and inferred.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
mo --input_model <INPUT_MODEL>.onnx
|
||||
|
||||
mo --input_model <INPUT_MODEL>.onnx
|
||||
|
||||
There are no ONNX specific parameters, so only framework-agnostic parameters are available to convert your model. For details, see the *General Conversion Parameters* section in the :doc:`Converting a Model to Intermediate Representation (IR) <openvino_docs_MO_DG_prepare_model_convert_model_Converting_Model>` guide.
|
||||
|
||||
|
@ -32,60 +32,58 @@ To convert a PaddlePaddle model, use the ``mo`` script and specify the path to t
|
||||
Converting PaddlePaddle Model From Memory Using Python API
|
||||
##########################################################
|
||||
|
||||
Model conversion API supports passing PaddlePaddle models directly from memory.
|
||||
|
||||
Following PaddlePaddle model formats are supported:
|
||||
Model conversion API supports passing the following PaddlePaddle models directly from memory:
|
||||
|
||||
* ``paddle.hapi.model.Model``
|
||||
* ``paddle.fluid.dygraph.layers.Layer``
|
||||
* ``paddle.fluid.executor.Executor``
|
||||
|
||||
Converting certain PaddlePaddle models may require setting ``example_input`` or ``example_output``. Below examples show how to execute such the conversion.
|
||||
When you convert certain PaddlePaddle models, you may need to set the ``example_input`` or ``example_output`` parameters first. Below you will find examples that show how to convert aforementioned model formats using the parameters.
|
||||
|
||||
* Example of converting ``paddle.hapi.model.Model`` format model:
|
||||
* ``paddle.hapi.model.Model``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
import paddle
|
||||
from openvino.tools.mo import convert_model
|
||||
|
||||
|
||||
# create a paddle.hapi.model.Model format model
|
||||
resnet50 = paddle.vision.models.resnet50()
|
||||
x = paddle.static.InputSpec([1,3,224,224], 'float32', 'x')
|
||||
y = paddle.static.InputSpec([1,1000], 'float32', 'y')
|
||||
|
||||
|
||||
model = paddle.Model(resnet50, x, y)
|
||||
|
||||
|
||||
# convert to OpenVINO IR format
|
||||
ov_model = convert_model(model)
|
||||
|
||||
|
||||
# optional: serialize OpenVINO IR to *.xml & *.bin
|
||||
from openvino.runtime import serialize
|
||||
serialize(ov_model, "ov_model.xml", "ov_model.bin")
|
||||
|
||||
* Example of converting ``paddle.fluid.dygraph.layers.Layer`` format model:
|
||||
* ``paddle.fluid.dygraph.layers.Layer``
|
||||
|
||||
``example_input`` is required while ``example_output`` is optional, which accept the following formats:
|
||||
``example_input`` is required while ``example_output`` is optional, and accept the following formats:
|
||||
|
||||
``list`` with tensor(``paddle.Tensor``) or InputSpec(``paddle.static.input.InputSpec``)
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
|
||||
import paddle
|
||||
from openvino.tools.mo import convert_model
|
||||
|
||||
|
||||
# create a paddle.fluid.dygraph.layers.Layer format model
|
||||
model = paddle.vision.models.resnet50()
|
||||
x = paddle.rand([1,3,224,224])
|
||||
|
||||
|
||||
# convert to OpenVINO IR format
|
||||
ov_model = convert_model(model, example_input=[x])
|
||||
|
||||
* Example of converting ``paddle.fluid.executor.Executor`` format model:
|
||||
* ``paddle.fluid.executor.Executor``
|
||||
|
||||
``example_input`` and ``example_output`` are required, which accept the following formats:
|
||||
``example_input`` and ``example_output`` are required, and accept the following formats:
|
||||
|
||||
``list`` or ``tuple`` with variable(``paddle.static.data``)
|
||||
|
||||
@ -94,86 +92,37 @@ Converting certain PaddlePaddle models may require setting ``example_input`` or
|
||||
|
||||
import paddle
|
||||
from openvino.tools.mo import convert_model
|
||||
|
||||
|
||||
paddle.enable_static()
|
||||
|
||||
|
||||
# create a paddle.fluid.executor.Executor format model
|
||||
x = paddle.static.data(name="x", shape=[1,3,224])
|
||||
y = paddle.static.data(name="y", shape=[1,3,224])
|
||||
relu = paddle.nn.ReLU()
|
||||
sigmoid = paddle.nn.Sigmoid()
|
||||
y = sigmoid(relu(x))
|
||||
|
||||
|
||||
exe = paddle.static.Executor(paddle.CPUPlace())
|
||||
exe.run(paddle.static.default_startup_program())
|
||||
|
||||
|
||||
# convert to OpenVINO IR format
|
||||
ov_model = convert_model(exe, example_input=[x], example_output=[y])
|
||||
|
||||
|
||||
.. important::
|
||||
|
||||
The ``convert_model()`` method returns ``ov.Model`` that you can optimize, compile, or save to a file for subsequent use.
|
||||
|
||||
|
||||
Supported PaddlePaddle Layers
|
||||
#############################
|
||||
|
||||
For the list of supported standard layers, refer to the :doc:`Supported Operations <openvino_resources_supported_operations_frontend>` page.
|
||||
|
||||
Officially Supported PaddlePaddle Models
|
||||
########################################
|
||||
|
||||
The following PaddlePaddle models have been officially validated and confirmed to work (as of OpenVINO 2022.1):
|
||||
|
||||
.. list-table::
|
||||
:widths: 20 25 55
|
||||
:header-rows: 1
|
||||
|
||||
* - Model Name
|
||||
- Model Type
|
||||
- Description
|
||||
* - ppocr-det
|
||||
- optical character recognition
|
||||
- Models are exported from `PaddleOCR <https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1/>`_. Refer to `READ.md <https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1/#pp-ocr-20-series-model-listupdate-on-dec-15>`_.
|
||||
* - ppocr-rec
|
||||
- optical character recognition
|
||||
- Models are exported from `PaddleOCR <https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1/>`_. Refer to `READ.md <https://github.com/PaddlePaddle/PaddleOCR/tree/release/2.1/#pp-ocr-20-series-model-listupdate-on-dec-15>`_.
|
||||
* - ResNet-50
|
||||
- classification
|
||||
- Models are exported from `PaddleClas <https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1/>`_. Refer to `getting_started_en.md <https://github.com/PaddlePaddle/PaddleClas/blob/release/2.1/docs/en/tutorials/getting_started_en.md#4-use-the-inference-model-to-predict>`_.
|
||||
* - MobileNet v2
|
||||
- classification
|
||||
- Models are exported from `PaddleClas <https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1/>`_. Refer to `getting_started_en.md <https://github.com/PaddlePaddle/PaddleClas/blob/release/2.1/docs/en/tutorials/getting_started_en.md#4-use-the-inference-model-to-predict>`_.
|
||||
* - MobileNet v3
|
||||
- classification
|
||||
- Models are exported from `PaddleClas <https://github.com/PaddlePaddle/PaddleClas/tree/release/2.1/>`_. Refer to `getting_started_en.md <https://github.com/PaddlePaddle/PaddleClas/blob/release/2.1/docs/en/tutorials/getting_started_en.md#4-use-the-inference-model-to-predict>`_.
|
||||
* - BiSeNet v2
|
||||
- semantic segmentation
|
||||
- Models are exported from `PaddleSeg <https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1>`_. Refer to `model_export.md <https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/docs/model_export.md#>`_.
|
||||
* - DeepLab v3 plus
|
||||
- semantic segmentation
|
||||
- Models are exported from `PaddleSeg <https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1>`_. Refer to `model_export.md <https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/docs/model_export.md#>`_.
|
||||
* - Fast-SCNN
|
||||
- semantic segmentation
|
||||
- Models are exported from `PaddleSeg <https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1>`_. Refer to `model_export.md <https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/docs/model_export.md#>`_.
|
||||
* - OCRNET
|
||||
- semantic segmentation
|
||||
- Models are exported from `PaddleSeg <https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.1>`_. Refer to `model_export.md <https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.1/docs/model_export.md#>`_.
|
||||
* - Yolo v3
|
||||
- detection
|
||||
- Models are exported from `PaddleDetection <https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.1>`_. Refer to `EXPORT_MODEL.md <https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/deploy/EXPORT_MODEL.md#>`_.
|
||||
* - ppyolo
|
||||
- detection
|
||||
- Models are exported from `PaddleDetection <https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.1>`_. Refer to `EXPORT_MODEL.md <https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/deploy/EXPORT_MODEL.md#>`_.
|
||||
* - MobileNetv3-SSD
|
||||
- detection
|
||||
- Models are exported from `PaddleDetection <https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.2>`_. Refer to `EXPORT_MODEL.md <https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.2/deploy/EXPORT_MODEL.md#>`_.
|
||||
* - U-Net
|
||||
- semantic segmentation
|
||||
- Models are exported from `PaddleSeg <https://github.com/PaddlePaddle/PaddleSeg/tree/release/2.3>`_. Refer to `model_export.md <https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.3/docs/model_export.md#>`_.
|
||||
* - BERT
|
||||
- language representation
|
||||
- Models are exported from `PaddleNLP <https://github.com/PaddlePaddle/PaddleNLP/tree/v2.1.1>`_. Refer to `README.md <https://github.com/PaddlePaddle/PaddleNLP/tree/develop/examples/language_model/bert#readme>`_.
|
||||
|
||||
Frequently Asked Questions (FAQ)
|
||||
################################
|
||||
|
||||
When model conversion API is unable to run to completion due to typographical errors, incorrectly used options, or other issues, it provides explanatory messages. They describe the potential cause of the problem and give a link to the :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>`, which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` to help you understand what went wrong.
|
||||
The model conversion API displays explanatory messages for typographical errors, incorrectly used options, or other issues. They describe the potential cause of the problem and give a link to the :doc:`Model Optimizer FAQ <openvino_docs_MO_DG_prepare_model_Model_Optimizer_FAQ>`, which provides instructions on how to resolve most issues. The FAQ also includes links to relevant sections in :doc:`Convert a Model <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` to help you understand what went wrong.
|
||||
|
||||
Additional Resources
|
||||
####################
|
||||
|
@ -33,8 +33,8 @@ Following PyTorch model formats are supported:
|
||||
|
||||
Converting certain PyTorch models may require model tracing, which needs ``input_shape`` or ``example_input`` parameters to be set.
|
||||
|
||||
``example_input`` is used as example input for model tracing.
|
||||
``input_shape`` is used for constructing a float zero-filled torch.Tensor for model tracing.
|
||||
* ``example_input`` is used as example input for model tracing.
|
||||
* ``input_shape`` is used for constructing a float zero-filled torch.Tensor for model tracing.
|
||||
|
||||
Example of using ``example_input``:
|
||||
|
||||
@ -56,6 +56,10 @@ Example of using ``example_input``:
|
||||
* ``list`` or ``tuple`` with tensors (``openvino.runtime.Tensor`` / ``torch.Tensor`` / ``np.ndarray``)
|
||||
* ``dictionary`` where key is the input name, value is the tensor (``openvino.runtime.Tensor`` / ``torch.Tensor`` / ``np.ndarray``)
|
||||
|
||||
.. important::
|
||||
|
||||
The ``convert_model()`` method returns ``ov.Model`` that you can optimize, compile, or save to a file for subsequent use.
|
||||
|
||||
Exporting a PyTorch Model to ONNX Format
|
||||
########################################
|
||||
|
||||
|
@ -299,6 +299,10 @@ Model conversion API supports passing TensorFlow/TensorFlow2 models directly fro
|
||||
checkpoint.restore(save_path)
|
||||
ov_model = convert_model(checkpoint)
|
||||
|
||||
.. important::
|
||||
|
||||
The ``convert_model()`` method returns ``ov.Model`` that you can optimize, compile, or save to a file for subsequent use.
|
||||
|
||||
Supported TensorFlow and TensorFlow 2 Keras Layers
|
||||
##################################################
|
||||
|
||||
|
@ -13,7 +13,11 @@ To convert a TensorFlow Lite model, use the ``mo`` script and specify the path t
|
||||
|
||||
mo --input_model <INPUT_MODEL>.tflite
|
||||
|
||||
.. note:: TensorFlow Lite models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <openvino_docs_OV_UG_Integrate_OV_with_your_application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
TensorFlow Lite models are supported via FrontEnd API. You may skip conversion to IR and read models directly by OpenVINO runtime API. Refer to the :doc:`inference example <openvino_docs_OV_UG_Integrate_OV_with_your_application>` for more details. Using ``convert_model`` is still necessary in more complex cases, such as new custom inputs/outputs in model pruning, adding pre-processing, or using Python conversion extensions.
|
||||
|
||||
.. important::
|
||||
|
||||
The ``convert_model()`` method returns ``ov.Model`` that you can optimize, compile, or save to a file for subsequent use.
|
||||
|
||||
Supported TensorFlow Lite Layers
|
||||
###################################
|
||||
|
@ -22,7 +22,7 @@ The following examples are the situations when model cutting is useful or even r
|
||||
Model conversion API parameters
|
||||
###############################
|
||||
|
||||
Model conversion API provides command line options ``input`` and ``output`` to specify new entry and exit nodes, while ignoring the rest of the model:
|
||||
Model conversion API provides ``input`` and ``output`` command-line options to specify new entry and exit nodes, while ignoring the rest of the model:
|
||||
|
||||
* ``input`` option accepts a list of layer names of the input model that should be treated as new entry points to the model. See the full list of accepted types for input on :doc:`Model Conversion Python API <openvino_docs_MO_DG_Python_API>` page.
|
||||
* ``output`` option accepts a list of layer names of the input model that should be treated as new exit points from the model.
|
||||
|
@ -17,31 +17,533 @@
|
||||
openvino_docs_MO_DG_prepare_model_convert_model_tutorials
|
||||
|
||||
.. meta::
|
||||
:description: In OpenVINO, ONNX, PaddlePaddle, TensorFlow and TensorFlow Lite
|
||||
models do not require any prior conversion, while MxNet, Caffe and Kaldi do.
|
||||
:description: Learn about supported model formats and the methods used to convert, read and compile them in OpenVINO™.
|
||||
|
||||
|
||||
**OpenVINO IR (Intermediate Representation)** - the proprietary format of OpenVINO™, benefiting from the full extent of its features.
|
||||
**OpenVINO IR (Intermediate Representation)** - the proprietary and default format of OpenVINO, benefiting from the full extent of its features. All other model formats presented below will ultimately be converted to :doc:`OpenVINO IR <openvino_ir>`.
|
||||
|
||||
**ONNX, PaddlePaddle, TensorFlow, TensorFlow Lite** - formats supported directly, which means they can be used with
|
||||
OpenVINO Runtime without any prior conversion. For a guide on how to run inference on ONNX, PaddlePaddle, or TensorFlow,
|
||||
see how to :doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
**PyTorch, TensorFlow, ONNX, and PaddlePaddle** may be used without any prior conversion and can be read by OpenVINO Runtime API by the use of ``read_model()`` or ``compile_model()``. Additional adjustment for the model can be performed using the ``convert_model()`` method, which allows you to set shapes, types or the layout of model inputs, cut parts of the model, freeze inputs etc. The detailed information of capabilities of ``convert_model()`` can be found in :doc:`this <openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide>` article.
|
||||
|
||||
**MXNet, Caffe, Kaldi** - legacy formats that need to be converted to OpenVINO IR before running inference.
|
||||
The model conversion in some cases may involve intermediate steps. OpenVINO is currently proceeding
|
||||
**to deprecate these formats** and **remove their support entirely in the future**.
|
||||
Below you will find code examples for each method, for all supported model formats.
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: PyTorch
|
||||
:sync: torch
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
This is the only method applicable to PyTorch models.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Python objects**:
|
||||
|
||||
* ``torch.nn.Module``
|
||||
* ``torch.jit.ScriptModule``
|
||||
* ``torch.jit.ScriptFunction``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
model = torchvision.models.resnet50(pretrained=True)
|
||||
ov_model = convert_model(model)
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_PyTorch>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/102-pytorch-onnx-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
.. tab-item:: TensorFlow
|
||||
:sync: tf
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
When you use the ``convert_model()`` method, you have more control and you can specify additional adjustments for ``ov.Model``. The ``read_model()`` and ``compile_model()`` methods are easier to use, however, they do not have such capabilities. With ``ov.Model`` you can choose to optimize, compile and run inference on it or serialize it into a file for subsequent use.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* SavedModel - ``<SAVED_MODEL_DIRECTORY>`` or ``<INPUT_MODEL>.pb``
|
||||
* Checkpoint - ``<INFERENCE_GRAPH>.pb`` or ``<INFERENCE_GRAPH>.pbtxt``
|
||||
* MetaGraph - ``<INPUT_META_GRAPH>.meta``
|
||||
|
||||
* **Python objects**:
|
||||
|
||||
* ``tf.keras.Model``
|
||||
* ``tf.keras.layers.Layer``
|
||||
* ``tf.Module``
|
||||
* ``tf.compat.v1.Graph``
|
||||
* ``tf.compat.v1.GraphDef``
|
||||
* ``tf.function``
|
||||
* ``tf.compat.v1.session``
|
||||
* ``tf.train.checkpoint``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = convert_model("saved_model.pb")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/101-tensorflow-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
* The ``read_model()`` and ``compile_model()`` methods:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* SavedModel - ``<SAVED_MODEL_DIRECTORY>`` or ``<INPUT_MODEL>.pb``
|
||||
* Checkpoint - ``<INFERENCE_GRAPH>.pb`` or ``<INFERENCE_GRAPH>.pbtxt``
|
||||
* MetaGraph - ``<INPUT_META_GRAPH>.meta``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = read_model("saved_model.pb")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
For TensorFlow format, see :doc:`TensorFlow Frontend Capabilities and Limitations <openvino_docs_MO_DG_TensorFlow_Frontend>`.
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* SavedModel - ``<SAVED_MODEL_DIRECTORY>`` or ``<INPUT_MODEL>.pb``
|
||||
* Checkpoint - ``<INFERENCE_GRAPH>.pb`` or ``<INFERENCE_GRAPH>.pbtxt``
|
||||
* MetaGraph - ``<INPUT_META_GRAPH>.meta``
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
ov::CompiledModel compiled_model = core.compile_model("saved_model.pb", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* SavedModel - ``<SAVED_MODEL_DIRECTORY>`` or ``<INPUT_MODEL>.pb``
|
||||
* Checkpoint - ``<INFERENCE_GRAPH>.pb`` or ``<INFERENCE_GRAPH>.pbtxt``
|
||||
* MetaGraph - ``<INPUT_META_GRAPH>.meta``
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
ov_compiled_model_t* compiled_model = NULL;
|
||||
ov_core_compile_model_from_file(core, "saved_model.pb", "AUTO", 0, &compiled_model);
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
||||
You can use ``mo`` command-line tool to convert a model to IR. The obtained IR can then be read by ``read_model()`` and inferred.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
mo --input_model <INPUT_MODEL>.pb
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`.
|
||||
|
||||
.. tab-item:: TensorFlow Lite
|
||||
:sync: tflite
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
When you use the ``convert_model()`` method, you have more control and you can specify additional adjustments for ``ov.Model``. The ``read_model()`` and ``compile_model()`` methods are easier to use, however, they do not have such capabilities. With ``ov.Model`` you can choose to optimize, compile and run inference on it or serialize it into a file for subsequent use.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.tflite``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = convert_model("<INPUT_MODEL>.tflite")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/119-tflite-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
||||
* The ``read_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.tflite``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = read_model("<INPUT_MODEL>.tflite")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.tflite``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
compiled_model = core.compile_model("<INPUT_MODEL>.tflite", "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.tflite``
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
ov::CompiledModel compiled_model = core.compile_model("<INPUT_MODEL>.tflite", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.tflite``
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
ov_compiled_model_t* compiled_model = NULL;
|
||||
ov_core_compile_model_from_file(core, "<INPUT_MODEL>.tflite", "AUTO", 0, &compiled_model);
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
You can use ``mo`` command-line tool to convert a model to IR. The obtained IR can then be read by ``read_model()`` and inferred.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.tflite``
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
mo --input_model <INPUT_MODEL>.tflite
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow_Lite>`.
|
||||
|
||||
.. tab-item:: ONNX
|
||||
:sync: onnx
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
When you use the ``convert_model()`` method, you have more control and you can specify additional adjustments for ``ov.Model``. The ``read_model()`` and ``compile_model()`` methods are easier to use, however, they do not have such capabilities. With ``ov.Model`` you can choose to optimize, compile and run inference on it or serialize it into a file for subsequent use.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.onnx``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = convert_model("<INPUT_MODEL>.onnx")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/102-pytorch-onnx-to-openvino-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
|
||||
* The ``read_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.onnx``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = read_model("<INPUT_MODEL>.onnx")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.onnx``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
compiled_model = core.compile_model("<INPUT_MODEL>.onnx", "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to :doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.onnx``
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
ov::CompiledModel compiled_model = core.compile_model("<INPUT_MODEL>.onnx", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to :doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.onnx``
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
ov_compiled_model_t* compiled_model = NULL;
|
||||
ov_core_compile_model_from_file(core, "<INPUT_MODEL>.onnx", "AUTO", 0, &compiled_model);
|
||||
|
||||
For details on the conversion, refer to the :doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
You can use ``mo`` command-line tool to convert a model to IR. The obtained IR can then be read by ``read_model()`` and inferred.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.onnx``
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
mo --input_model <INPUT_MODEL>.onnx
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
|
||||
.. tab-item:: PaddlePaddle
|
||||
:sync: pdpd
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
When you use the ``convert_model()`` method, you have more control and you can specify additional adjustments for ``ov.Model``. The ``read_model()`` and ``compile_model()`` methods are easier to use, however, they do not have such capabilities. With ``ov.Model`` you can choose to optimize, compile and run inference on it or serialize it into a file for subsequent use.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.pdmodel``
|
||||
|
||||
* **Python objects**:
|
||||
|
||||
* ``paddle.hapi.model.Model``
|
||||
* ``paddle.fluid.dygraph.layers.Layer``
|
||||
* ``paddle.fluid.executor.Executor``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = convert_model("<INPUT_MODEL>.pdmodel")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
For more details on conversion, refer to the
|
||||
:doc:`guide <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>`
|
||||
and an example `tutorial <https://docs.openvino.ai/nightly/notebooks/103-paddle-to-openvino-classification-with-output.html>`__
|
||||
on this topic.
|
||||
|
||||
* The ``read_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.pdmodel``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
ov_model = read_model("<INPUT_MODEL>.pdmodel")
|
||||
compiled_model = core.compile_model(ov_model, "AUTO")
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.pdmodel``
|
||||
|
||||
.. code-block:: py
|
||||
:force:
|
||||
|
||||
compiled_model = core.compile_model("<INPUT_MODEL>.pdmodel", "AUTO")
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.pdmodel``
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
ov::CompiledModel compiled_model = core.compile_model("<INPUT_MODEL>.pdmodel", "AUTO");
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: C
|
||||
:sync: c
|
||||
|
||||
* The ``compile_model()`` method:
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.pdmodel``
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
ov_compiled_model_t* compiled_model = NULL;
|
||||
ov_core_compile_model_from_file(core, "<INPUT_MODEL>.pdmodel", "AUTO", 0, &compiled_model);
|
||||
|
||||
For a guide on how to run inference, see how to
|
||||
:doc:`Integrate OpenVINO™ with Your Application <openvino_docs_OV_UG_Integrate_OV_with_your_application>`.
|
||||
|
||||
.. tab-item:: CLI
|
||||
:sync: cli
|
||||
|
||||
* The ``convert_model()`` method:
|
||||
|
||||
You can use ``mo`` command-line tool to convert a model to IR. The obtained IR can then be read by ``read_model()`` and inferred.
|
||||
|
||||
.. dropdown:: List of supported formats:
|
||||
|
||||
* **Files**:
|
||||
|
||||
* ``<INPUT_MODEL>.pdmodel``
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
mo --input_model <INPUT_MODEL>.pdmodel
|
||||
|
||||
For details on the conversion, refer to the
|
||||
:doc:`article <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>`.
|
||||
|
||||
|
||||
**MXNet, Caffe, and Kaldi** are legacy formats that need to be converted to OpenVINO IR before running inference. The model conversion in some cases may involve intermediate steps. For more details, refer to the :doc:`MXNet <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_MxNet>`, :doc:`Caffe <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe>`, :doc:`Kaldi <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Kaldi>` conversion guides.
|
||||
|
||||
OpenVINO is currently proceeding **to deprecate these formats** and **remove their support entirely in the future**. Converting these formats to ONNX or using an LTS version might be a viable solution for inference in OpenVINO Toolkit.
|
||||
|
||||
.. note::
|
||||
|
||||
To convert models, :doc:`install OpenVINO™ Development Tools <openvino_docs_install_guides_install_dev_tools>`,
|
||||
which include model conversion API.
|
||||
|
||||
|
||||
Refer to the following articles for details on conversion for different formats and models:
|
||||
|
||||
* :doc:`How to convert ONNX <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_ONNX>`
|
||||
* :doc:`How to convert PaddlePaddle <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Paddle>`
|
||||
* :doc:`How to convert TensorFlow <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow>`
|
||||
* :doc:`How to convert TensorFlow Lite <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow_Lite>`
|
||||
* :doc:`How to convert MXNet <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_MxNet>`
|
||||
* :doc:`How to convert Caffe <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Caffe>`
|
||||
* :doc:`How to convert Kaldi <openvino_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_Kaldi>`
|
||||
|
||||
* :doc:`Conversion examples for specific models <openvino_docs_MO_DG_prepare_model_convert_model_tutorials>`
|
||||
* :doc:`Model preparation methods <openvino_docs_model_processing_introduction>`
|
||||
|
||||
@endsphinxdirective
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:53f6f30af6d39d91d7f3f4e3bbd086e3dbc94e5ac97233d56a90826579759e7f
|
||||
size 104225
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bc27fc105f73d9fb6e1a5436843c090c0748486632084aa27611222b2738a108
|
||||
size 187128
|
||||
oid sha256:894cc0f49385b304f7129b31e616cfc47dd188e910fca8d726b006bcbb3082f3
|
||||
size 252381
|
||||
|
@ -13,8 +13,7 @@ Also, the frontend allows loading TensorFlow models in SavedModel, MetaGraph, an
|
||||
The current limitations:
|
||||
|
||||
* IRs generated by new TensorFlow Frontend are compatible only with OpenVINO API 2.0
|
||||
* There is no full parity between the legacy frontend and the new frontend in MO. Known limitations compared to the legacy approach are: TF1 Control flow, Complex types, models requiring config files and old python extensions. The solution detects unsupported functionalities and provides fallback.
|
||||
* There is no full parity between the legacy frontend and the new frontend in MO. Known limitations compared to the legacy approach are: TF1 Control flow, Complex types, models requiring config files and old python extensions. The solution detects unsupported functionalities and provides fallback. To force the use of the legacy frontend, ``--use_legacy_frontend`` must be specified.
|
||||
|
||||
To force the use of the legacy frontend, ``--use_legacy_frontend`` must be specified.
|
||||
|
||||
@endsphinxdirective
|
||||
|
@ -49,6 +49,7 @@ def cache_root_path():
|
||||
return cache_root
|
||||
|
||||
def get_device():
|
||||
core = Core()
|
||||
device = "CPU"
|
||||
|
||||
if os.getenv("OPENVINO_TORCH_BACKEND_DEVICE") is not None:
|
||||
|
@ -35,6 +35,7 @@ class TorchScriptPythonDecoder (Decoder):
|
||||
self.m_decoders = []
|
||||
self._input_signature = None
|
||||
self._shared_memory = shared_memory
|
||||
self._input_is_list = False
|
||||
if graph_element is None:
|
||||
try:
|
||||
pt_module = self._get_scripted_model(pt_module, example_input)
|
||||
@ -136,11 +137,16 @@ class TorchScriptPythonDecoder (Decoder):
|
||||
return {"example_inputs": [inputs[name] for name in ordered_inputs]}, ordered_inputs, wrapped_model
|
||||
|
||||
def prepare_example_inputs_and_model(inputs, input_params, model):
|
||||
input_signature = list(input_params)
|
||||
if isinstance(inputs, dict):
|
||||
return process_dict_inputs(inputs, input_params, model)
|
||||
if isinstance(inputs, list) and len(inputs) == 1 and isinstance(inputs[0], torch.Tensor):
|
||||
if "typing.List" in str(input_params[input_signature[0]].annotation):
|
||||
inputs = inputs[0].unsqueeze(0)
|
||||
self._input_is_list = True
|
||||
|
||||
if isinstance(inputs, torch.Tensor):
|
||||
inputs = [inputs]
|
||||
input_signature = list(input_params)
|
||||
input_signature = input_signature[:len(inputs)]
|
||||
return {"example_inputs": inputs}, input_signature, model
|
||||
|
||||
@ -164,7 +170,7 @@ class TorchScriptPythonDecoder (Decoder):
|
||||
try:
|
||||
scripted = torch.jit.trace(pt_module, **input_parameters, strict=False)
|
||||
except Exception as te:
|
||||
raise f"Tracing failed with exception {te}\nScripting failed with exception: {se}"
|
||||
raise Exception(f"Tracing failed with exception {te}\nScripting failed with exception: {se}")
|
||||
skip_freeze = False
|
||||
for n in scripted.inlined_graph.nodes():
|
||||
# TODO: switch off freezing for all traced models
|
||||
|
@ -2,7 +2,6 @@
|
||||
# Copyright (C) 2018-2023 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import tempfile
|
||||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
@ -10,6 +9,7 @@ from openvino.runtime.op import Parameter, Constant
|
||||
from openvino.runtime.opset12 import add, multiply
|
||||
|
||||
import openvino as ov
|
||||
from tests.test_utils.test_utils import create_filename_for_test
|
||||
|
||||
|
||||
def make_constant(values, transposed):
|
||||
@ -37,12 +37,11 @@ def make_model(add_consts, mul_consts):
|
||||
return ov.Model([mul1], [parameter1])
|
||||
|
||||
|
||||
def get_constants(model) -> List[Constant]:
|
||||
from pathlib import Path
|
||||
model_name = Path(tempfile.gettempdir()) / "f32_partially_compressed.xml"
|
||||
ov.save_model(model, model_name)
|
||||
def get_constants(model, request, tmp_path) -> List[Constant]:
|
||||
model_fname, _ = create_filename_for_test(request.node.name, tmp_path)
|
||||
ov.save_model(model, model_fname)
|
||||
core = ov.Core()
|
||||
restored_model = core.read_model(model_name)
|
||||
restored_model = core.read_model(model_fname)
|
||||
|
||||
op_ind_map = {"Add": 0, "Multiply": 1}
|
||||
constants_list = [[]] * len(op_ind_map)
|
||||
@ -70,9 +69,9 @@ def get_constants(model) -> List[Constant]:
|
||||
return constants_list
|
||||
|
||||
|
||||
def test_compression_1():
|
||||
def test_compression_1(request, tmp_path):
|
||||
model = make_model(more_in_range, more_out_of_range)
|
||||
const_fp16, const_fp32 = get_constants(model)
|
||||
const_fp16, const_fp32 = get_constants(model, request, tmp_path)
|
||||
assert const_fp32 is not None, "There is no Constant op on FP32 branch"
|
||||
assert const_fp16 is not None, "There is no compressed Constant + Convert op on FP16 branch"
|
||||
|
||||
@ -85,9 +84,9 @@ def test_compression_1():
|
||||
assert np.all(np.array(converted_more_in_range, dtype=np.float32) == const_fp16.get_vector()), msg
|
||||
|
||||
|
||||
def test_compression_2():
|
||||
def test_compression_2(request, tmp_path):
|
||||
model = make_model(more_in_range, more_in_range)
|
||||
const_fp16_1, const_fp16_2 = get_constants(model)
|
||||
const_fp16_1, const_fp16_2 = get_constants(model, request, tmp_path)
|
||||
|
||||
assert const_fp16_1 is not None, "There is no Constant op on FP16 branch"
|
||||
assert const_fp16_2 is not None, "There is no Constant op on FP16 branch"
|
||||
@ -101,9 +100,9 @@ def test_compression_2():
|
||||
assert np.all(in_range_clipped == const_fp16_2.get_vector())
|
||||
|
||||
|
||||
def test_no_compression():
|
||||
def test_no_compression(request, tmp_path):
|
||||
model = make_model(more_out_of_range, more_out_of_range)
|
||||
const_fp32_1, const_fp32_2 = get_constants(model)
|
||||
const_fp32_1, const_fp32_2 = get_constants(model, request, tmp_path)
|
||||
|
||||
assert const_fp32_1 is not None, "There is no Constant op on FP32 branch"
|
||||
assert const_fp32_2 is not None, "There is no Constant op on FP32 branch"
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
set(TARGET_NAME openvino_itt)
|
||||
|
||||
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp")
|
||||
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp" "include/*.hpp")
|
||||
|
||||
add_library(${TARGET_NAME} STATIC ${SOURCES})
|
||||
|
||||
|
@ -10,17 +10,17 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(__GNUC__) || (defined(__ICC) && (__ICC >= 600))
|
||||
#define ITT_FUNCTION_NAME __PRETTY_FUNCTION__
|
||||
# define ITT_FUNCTION_NAME __PRETTY_FUNCTION__
|
||||
#elif defined(__FUNCSIG__)
|
||||
#define ITT_FUNCTION_NAME __FUNCSIG__
|
||||
# define ITT_FUNCTION_NAME __FUNCSIG__
|
||||
#elif (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600))
|
||||
#define ITT_FUNCTION_NAME __FUNCTION__
|
||||
# define ITT_FUNCTION_NAME __FUNCTION__
|
||||
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
|
||||
#define ITT_FUNCTION_NAME __func__
|
||||
# define ITT_FUNCTION_NAME __func__
|
||||
#elif defined(_MSC_VER) && (_MSC_VER >= 1900) /* VS2015 */
|
||||
#define ITT_FUNCTION_NAME __func__
|
||||
# define ITT_FUNCTION_NAME __func__
|
||||
#elif defined(__cplusplus) && (__cplusplus >= 201103)
|
||||
#define ITT_FUNCTION_NAME __func__
|
||||
# define ITT_FUNCTION_NAME __func__
|
||||
#else
|
||||
#error "Function name is N/A"
|
||||
# error "Function name is N/A"
|
||||
#endif
|
||||
|
@ -17,206 +17,192 @@
|
||||
#include "openvino/util/pp.hpp"
|
||||
|
||||
/** @ingroup ov_dev_profiling
|
||||
* @brief openvino namespace
|
||||
*/
|
||||
namespace openvino
|
||||
{
|
||||
namespace itt
|
||||
{
|
||||
/**
|
||||
* @typedef domain_t
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief A domain type which enables tagging trace data for different modules or libraries in a program.
|
||||
*/
|
||||
typedef struct domain_ {} *domain_t;
|
||||
* @brief openvino namespace
|
||||
*/
|
||||
namespace openvino {
|
||||
namespace itt {
|
||||
/**
|
||||
* @typedef domain_t
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief A domain type which enables tagging trace data for different modules or libraries in a program.
|
||||
*/
|
||||
typedef struct domain_ {
|
||||
} * domain_t;
|
||||
|
||||
/**
|
||||
* @typedef handle_t
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Annotation handle for section of code which would be named at runtime.
|
||||
*/
|
||||
typedef struct handle_ {} *handle_t;
|
||||
/**
|
||||
* @typedef handle_t
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Annotation handle for section of code which would be named at runtime.
|
||||
*/
|
||||
typedef struct handle_ {
|
||||
} * handle_t;
|
||||
|
||||
/**
|
||||
* @cond
|
||||
*/
|
||||
namespace internal
|
||||
{
|
||||
domain_t domain(char const* name);
|
||||
handle_t handle(char const* name);
|
||||
void taskBegin(domain_t d, handle_t t);
|
||||
void taskEnd(domain_t d);
|
||||
void threadName(const char* name);
|
||||
/**
|
||||
* @cond
|
||||
*/
|
||||
namespace internal {
|
||||
domain_t domain(char const* name);
|
||||
handle_t handle(char const* name);
|
||||
void taskBegin(domain_t d, handle_t t);
|
||||
void taskEnd(domain_t d);
|
||||
void threadName(const char* name);
|
||||
} // namespace internal
|
||||
/**
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fn void threadName(const char* name)
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Set thread name using a char string.
|
||||
* @param name [in] The thread name
|
||||
*/
|
||||
inline void threadName(const char* name) {
|
||||
internal::threadName(name);
|
||||
}
|
||||
|
||||
inline void threadName(const std::string& name) {
|
||||
internal::threadName(name.c_str());
|
||||
}
|
||||
|
||||
inline handle_t handle(char const* name) {
|
||||
return internal::handle(name);
|
||||
}
|
||||
|
||||
inline handle_t handle(const std::string& name) {
|
||||
return internal::handle(name.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn handle_t handle(char const *name)
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Create annotation handle with a given name.
|
||||
* @details If template function is instantiated with a tag, the handle is created as a singleton.
|
||||
* @param name [in] The annotation name
|
||||
*/
|
||||
template <typename Tag>
|
||||
handle_t handle(char const* name) {
|
||||
static auto h = internal::handle(name);
|
||||
return h;
|
||||
}
|
||||
|
||||
template <typename Tag>
|
||||
handle_t handle(const std::string& name) {
|
||||
return handle<Tag>(name.c_str());
|
||||
}
|
||||
|
||||
template <typename Tag>
|
||||
handle_t handle(handle_t h) {
|
||||
return h;
|
||||
}
|
||||
|
||||
/**
|
||||
* @class ScopedTask
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Used to annotate section of code which would be named at runtime
|
||||
* @tparam The @p domain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.
|
||||
*/
|
||||
template <domain_t (*domain)()>
|
||||
struct ScopedTask {
|
||||
/**
|
||||
* @brief Construct ScopedTask with defined annotation handle
|
||||
*/
|
||||
ScopedTask(handle_t taskHandle) noexcept {
|
||||
internal::taskBegin(domain(), taskHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The ScopedTask destructor closes or ends the task scope
|
||||
*/
|
||||
~ScopedTask() noexcept {
|
||||
internal::taskEnd(domain());
|
||||
}
|
||||
|
||||
ScopedTask(const ScopedTask&) = delete;
|
||||
ScopedTask& operator=(const ScopedTask&) = delete;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class TaskChain
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Used to annotate a sequence of sections of code which would be named at runtime
|
||||
* @tparam The @p domain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.
|
||||
*/
|
||||
template <domain_t (*domain)()>
|
||||
class TaskChain {
|
||||
uint32_t _id = 1;
|
||||
std::string _prefix;
|
||||
bool _skipped{};
|
||||
|
||||
TaskChain(const TaskChain&) = delete;
|
||||
TaskChain& operator=(const TaskChain&) = delete;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct TaskChain with defined annotation handle
|
||||
*/
|
||||
TaskChain(handle_t taskHandle, std::string&& prefix) noexcept : _prefix(std::forward<std::string>(prefix)) {
|
||||
internal::taskBegin(domain(), taskHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The TaskChain destructor closes or ends the task scope
|
||||
*/
|
||||
~TaskChain() noexcept {
|
||||
skip();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Ends the previous task from the chain and starts a new one with the given annotation handle
|
||||
*/
|
||||
void next(handle_t taskHandle) {
|
||||
if (_skipped)
|
||||
_skipped = false;
|
||||
else
|
||||
internal::taskEnd(domain());
|
||||
internal::taskBegin(domain(), taskHandle);
|
||||
++_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Generating a task name using a sequence number.
|
||||
*/
|
||||
std::string taskName() const {
|
||||
return _prefix + "_" + std::to_string(_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Generating a task name using a scope name.
|
||||
*/
|
||||
std::string taskNameOrHandle(const std::string& name) const {
|
||||
return _prefix + "_" + name;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Returns a handle provided as argument.
|
||||
*/
|
||||
handle_t taskNameOrHandle(handle_t handle) const {
|
||||
return handle;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Skips the remaining task scope.
|
||||
*/
|
||||
void skip() {
|
||||
if (!_skipped) {
|
||||
_skipped = true;
|
||||
internal::taskEnd(domain());
|
||||
}
|
||||
/**
|
||||
* @endcond
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fn void threadName(const char* name)
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Set thread name using a char string.
|
||||
* @param name [in] The thread name
|
||||
*/
|
||||
inline void threadName(const char* name)
|
||||
{
|
||||
internal::threadName(name);
|
||||
}
|
||||
|
||||
inline void threadName(const std::string &name)
|
||||
{
|
||||
internal::threadName(name.c_str());
|
||||
}
|
||||
|
||||
inline handle_t handle(char const *name)
|
||||
{
|
||||
return internal::handle(name);
|
||||
}
|
||||
|
||||
inline handle_t handle(const std::string &name)
|
||||
{
|
||||
return internal::handle(name.c_str());
|
||||
}
|
||||
|
||||
/**
|
||||
* @fn handle_t handle(char const *name)
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Create annotation handle with a given name.
|
||||
* @details If template function is instantiated with a tag, the handle is created as a singleton.
|
||||
* @param name [in] The annotation name
|
||||
*/
|
||||
template <typename Tag>
|
||||
handle_t handle(char const *name)
|
||||
{
|
||||
static auto h = internal::handle(name);
|
||||
return h;
|
||||
}
|
||||
|
||||
template <typename Tag>
|
||||
handle_t handle(const std::string &name)
|
||||
{
|
||||
return handle<Tag>(name.c_str());
|
||||
}
|
||||
|
||||
template <typename Tag>
|
||||
handle_t handle(handle_t h)
|
||||
{
|
||||
return h;
|
||||
}
|
||||
|
||||
/**
|
||||
* @class ScopedTask
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Used to annotate section of code which would be named at runtime
|
||||
* @tparam The @p domain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.
|
||||
*/
|
||||
template <domain_t(*domain)()>
|
||||
struct ScopedTask
|
||||
{
|
||||
/**
|
||||
* @brief Construct ScopedTask with defined annotation handle
|
||||
*/
|
||||
ScopedTask(handle_t taskHandle) noexcept
|
||||
{
|
||||
internal::taskBegin(domain(), taskHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The ScopedTask destructor closes or ends the task scope
|
||||
*/
|
||||
~ScopedTask() noexcept { internal::taskEnd(domain()); }
|
||||
|
||||
ScopedTask(const ScopedTask&) = delete;
|
||||
ScopedTask& operator=(const ScopedTask&) = delete;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class TaskChain
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Used to annotate a sequence of sections of code which would be named at runtime
|
||||
* @tparam The @p domain parameter is domain type which shoud be defined with OV_ITT_DOMAIN() macro.
|
||||
*/
|
||||
template <domain_t(*domain)()>
|
||||
class TaskChain
|
||||
{
|
||||
uint32_t _id = 1;
|
||||
std::string _prefix;
|
||||
bool _skipped {};
|
||||
|
||||
TaskChain(const TaskChain&) = delete;
|
||||
TaskChain& operator=(const TaskChain&) = delete;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct TaskChain with defined annotation handle
|
||||
*/
|
||||
TaskChain(handle_t taskHandle, std::string && prefix) noexcept
|
||||
: _prefix(std::forward<std::string>(prefix))
|
||||
{
|
||||
internal::taskBegin(domain(), taskHandle);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The TaskChain destructor closes or ends the task scope
|
||||
*/
|
||||
~TaskChain() noexcept { skip(); }
|
||||
|
||||
/**
|
||||
* @brief Ends the previous task from the chain and starts a new one with the given annotation handle
|
||||
*/
|
||||
void next(handle_t taskHandle)
|
||||
{
|
||||
if(_skipped)
|
||||
_skipped = false;
|
||||
else
|
||||
internal::taskEnd(domain());
|
||||
internal::taskBegin(domain(), taskHandle);
|
||||
++_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Generating a task name using a sequence number.
|
||||
*/
|
||||
std::string taskName() const
|
||||
{
|
||||
return _prefix + "_" + std::to_string(_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Generating a task name using a scope name.
|
||||
*/
|
||||
std::string taskNameOrHandle(const std::string & name) const
|
||||
{
|
||||
return _prefix + "_" + name;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Returns a handle provided as argument.
|
||||
*/
|
||||
handle_t taskNameOrHandle(handle_t handle) const
|
||||
{
|
||||
return handle;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Skips the remaining task scope.
|
||||
*/
|
||||
void skip()
|
||||
{
|
||||
if(!_skipped)
|
||||
{
|
||||
_skipped = true;
|
||||
internal::taskEnd(domain());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @def OV_ITT_DOMAIN(domainName)
|
||||
* @ingroup ov_dev_profiling
|
||||
* @brief Declare domain with a given name.
|
||||
* @param domainName [in] Known at compile time name of module or library (the domain name).
|
||||
* @param domainDisplayName [in] Domain name used as the ITT counter name and displayed in Intel VTune. Parameter is optional.
|
||||
* @param domainDisplayName [in] Domain name used as the ITT counter name and displayed in Intel VTune. Parameter is
|
||||
* optional.
|
||||
*/
|
||||
#define OV_ITT_DOMAIN(...) OV_PP_OVERLOAD(OV_ITT_DOMAIN, __VA_ARGS__)
|
||||
|
||||
@ -226,19 +212,17 @@ namespace openvino
|
||||
* @cond
|
||||
*/
|
||||
|
||||
#define OV_ITT_DOMAIN_1(domainName) \
|
||||
inline openvino::itt::domain_t domainName() noexcept \
|
||||
{ \
|
||||
static auto d = openvino::itt::internal::domain(#domainName); \
|
||||
return d; \
|
||||
}
|
||||
#define OV_ITT_DOMAIN_1(domainName) \
|
||||
inline openvino::itt::domain_t domainName() noexcept { \
|
||||
static auto d = openvino::itt::internal::domain(#domainName); \
|
||||
return d; \
|
||||
}
|
||||
|
||||
#define OV_ITT_DOMAIN_2(domainName, domainDisplayName) \
|
||||
inline openvino::itt::domain_t domainName() noexcept \
|
||||
{ \
|
||||
static auto d = openvino::itt::internal::domain(domainDisplayName); \
|
||||
return d; \
|
||||
}
|
||||
#define OV_ITT_DOMAIN_2(domainName, domainDisplayName) \
|
||||
inline openvino::itt::domain_t domainName() noexcept { \
|
||||
static auto d = openvino::itt::internal::domain(domainDisplayName); \
|
||||
return d; \
|
||||
}
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
@ -253,7 +237,7 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
* @param domainName [in] Known at compile time name of module or library (the domain name).
|
||||
* @param handleOrTaskName [in] The annotation name or handle for section of code. Parameter is optional.
|
||||
*/
|
||||
#define OV_ITT_SCOPE(group, ...) \
|
||||
#define OV_ITT_SCOPE(group, ...) \
|
||||
OV_PP_EXPAND(OV_PP_CAT(OV_ITT_SCOPE_IMPL_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(__VA_ARGS__))
|
||||
|
||||
/**
|
||||
@ -263,13 +247,13 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
#define OV_ITT_SCOPE_IMPL_0(...)
|
||||
#define OV_ITT_SCOPE_IMPL_1(...) OV_PP_OVERLOAD(OV_ITT_SCOPE, __VA_ARGS__)
|
||||
|
||||
#define OV_ITT_SCOPE_1(domain) \
|
||||
openvino::itt::ScopedTask<domain> OV_PP_CAT(ittScopedTask, __LINE__) \
|
||||
(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(ITT_FUNCTION_NAME));
|
||||
#define OV_ITT_SCOPE_1(domain) \
|
||||
openvino::itt::ScopedTask<domain> OV_PP_CAT(ittScopedTask, __LINE__)( \
|
||||
openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(ITT_FUNCTION_NAME));
|
||||
|
||||
#define OV_ITT_SCOPE_2(domain, taskOrTaskName) \
|
||||
openvino::itt::ScopedTask<domain> OV_PP_CAT(ittScopedTask, __LINE__) \
|
||||
(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(taskOrTaskName));
|
||||
#define OV_ITT_SCOPE_2(domain, taskOrTaskName) \
|
||||
openvino::itt::ScopedTask<domain> OV_PP_CAT(ittScopedTask, __LINE__)( \
|
||||
openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(taskOrTaskName));
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
@ -297,7 +281,7 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
* @param prefix [in] The task chain name prefix. The task name starts with this prefix. Parameter is optional.
|
||||
* @param taskName [in] The annotation name for section of code. Parameter is optional.
|
||||
*/
|
||||
#define OV_ITT_SCOPE_CHAIN(group, ...) \
|
||||
#define OV_ITT_SCOPE_CHAIN(group, ...) \
|
||||
OV_PP_EXPAND(OV_PP_CAT(OV_ITT_SCOPE_CHAIN_IMPL_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(__VA_ARGS__))
|
||||
|
||||
/**
|
||||
@ -307,23 +291,20 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
#define OV_ITT_SCOPE_CHAIN_IMPL_0(...)
|
||||
#define OV_ITT_SCOPE_CHAIN_IMPL_1(...) OV_PP_OVERLOAD(OV_ITT_SCOPE_CHAIN, __VA_ARGS__)
|
||||
|
||||
#define OV_ITT_SCOPE_CHAIN_2(chainId, domain) \
|
||||
openvino::itt::TaskChain<domain> chainId \
|
||||
(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)> \
|
||||
(std::string(ITT_FUNCTION_NAME) + "_1"), \
|
||||
ITT_FUNCTION_NAME);
|
||||
#define OV_ITT_SCOPE_CHAIN_2(chainId, domain) \
|
||||
openvino::itt::TaskChain<domain> chainId( \
|
||||
openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(std::string(ITT_FUNCTION_NAME) + "_1"), \
|
||||
ITT_FUNCTION_NAME);
|
||||
|
||||
#define OV_ITT_SCOPE_CHAIN_3(chainId, domain, prefix) \
|
||||
openvino::itt::TaskChain<domain> chainId \
|
||||
(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)> \
|
||||
(std::string(prefix) + "_1"), \
|
||||
prefix);
|
||||
#define OV_ITT_SCOPE_CHAIN_3(chainId, domain, prefix) \
|
||||
openvino::itt::TaskChain<domain> chainId( \
|
||||
openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(std::string(prefix) + "_1"), \
|
||||
prefix);
|
||||
|
||||
#define OV_ITT_SCOPE_CHAIN_4(chainId, domain, prefix, taskName) \
|
||||
openvino::itt::TaskChain<domain> chainId \
|
||||
(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)> \
|
||||
(std::string(prefix) + "_" + taskName), \
|
||||
prefix);
|
||||
#define OV_ITT_SCOPE_CHAIN_4(chainId, domain, prefix, taskName) \
|
||||
openvino::itt::TaskChain<domain> chainId( \
|
||||
openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(std::string(prefix) + "_" + taskName), \
|
||||
prefix);
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
@ -338,7 +319,7 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
* @param chainId [in] The tasks chain identifier.
|
||||
* @param taskOrTaskName [in] The annotation name or handle for section of code. Parameter is optional.
|
||||
*/
|
||||
#define OV_ITT_SCOPE_NEXT(group, ...) \
|
||||
#define OV_ITT_SCOPE_NEXT(group, ...) \
|
||||
OV_PP_EXPAND(OV_PP_CAT(OV_ITT_SCOPE_NEXT_IMPL_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(__VA_ARGS__))
|
||||
|
||||
/**
|
||||
@ -348,11 +329,11 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
#define OV_ITT_SCOPE_NEXT_IMPL_0(...)
|
||||
#define OV_ITT_SCOPE_NEXT_IMPL_1(...) OV_PP_OVERLOAD(OV_ITT_SCOPE_NEXT, __VA_ARGS__)
|
||||
|
||||
#define OV_ITT_SCOPE_NEXT_1(chainId) \
|
||||
chainId.next(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(chainId.taskName()));
|
||||
#define OV_ITT_SCOPE_NEXT_1(chainId) \
|
||||
chainId.next(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(chainId.taskName()));
|
||||
|
||||
#define OV_ITT_SCOPE_NEXT_2(chainId, taskOrTaskName) \
|
||||
chainId.next(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(chainId.taskNameOrHandle(taskOrTaskName)));
|
||||
#define OV_ITT_SCOPE_NEXT_2(chainId, taskOrTaskName) \
|
||||
chainId.next(openvino::itt::handle<struct OV_PP_CAT(Task, __LINE__)>(chainId.taskNameOrHandle(taskOrTaskName)));
|
||||
|
||||
/**
|
||||
* @endcond
|
||||
@ -365,7 +346,7 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
* @param group [in] ITT counter group name used for enabling/disabling at compile time.
|
||||
* @param chainId [in] The tasks chain identifier.
|
||||
*/
|
||||
#define OV_ITT_SCOPE_SKIP(group, chainId) \
|
||||
#define OV_ITT_SCOPE_SKIP(group, chainId) \
|
||||
OV_PP_EXPAND(OV_PP_CAT(OV_ITT_SCOPE_SKIP_, OV_PP_IS_ENABLED(OV_ITT_GROUP(group)))(chainId))
|
||||
|
||||
/**
|
||||
@ -410,5 +391,5 @@ inline openvino::itt::domain_t domainName() noexcept
|
||||
*/
|
||||
#define OV_ITT_TASK_SKIP(chainId) OV_ITT_SCOPE_SKIP(ALL, chainId);
|
||||
|
||||
} // namespace itt
|
||||
} // namespace openvino
|
||||
} // namespace itt
|
||||
} // namespace openvino
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
ExpressionPort() = default;
|
||||
explicit ExpressionPort(const std::shared_ptr<Expression>& expr, Type type, size_t port);
|
||||
|
||||
const std::shared_ptr<Expression>& get_expr() const { return m_expr; }
|
||||
std::shared_ptr<Expression> get_expr() const;
|
||||
Type get_type() const { return m_type; }
|
||||
size_t get_index() const { return m_port_index; }
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
friend bool operator<(const ExpressionPort& lhs, const ExpressionPort& rhs);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Expression> m_expr;
|
||||
std::weak_ptr<Expression> m_expr;
|
||||
Type m_type = Type::Output;
|
||||
size_t m_port_index = 0;
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ ExpressionPtr LinearIR::ExpressionFactory::create(const std::shared_ptr<ov::op::
|
||||
const LinearIR& linear_ir, const std::shared_ptr<ov::Model>& model) {
|
||||
// Note: ctor of shared_ptr isn't friend class for Expression -> we cannot use directly make_shared<Expression>(args)
|
||||
OPENVINO_ASSERT(model != nullptr, "To create IOExpression from Parameter there must be inited model!");
|
||||
auto expr = std::make_shared<IOExpression>(IOExpression(par, model->get_parameter_index(par)));
|
||||
auto expr = std::shared_ptr<IOExpression>(new IOExpression(par, model->get_parameter_index(par)));
|
||||
create_expression_outputs(expr);
|
||||
expr->validate();
|
||||
return expr;
|
||||
@ -67,7 +67,7 @@ ExpressionPtr LinearIR::ExpressionFactory::create(const std::shared_ptr<ov::op::
|
||||
const LinearIR& linear_ir, const std::shared_ptr<ov::Model>& model) {
|
||||
// Note: ctor of shared_ptr isn't friend class for Expression -> we cannot use directly make_shared<Expression>(args)
|
||||
OPENVINO_ASSERT(model != nullptr, "To create IOExpression from Result there must be inited model!");
|
||||
auto expr = std::make_shared<IOExpression>(IOExpression(res, model->get_result_index(res)));
|
||||
auto expr = std::shared_ptr<IOExpression>(new IOExpression(res, model->get_result_index(res)));
|
||||
create_expression_inputs(linear_ir, expr);
|
||||
// The Result node don't need output port (because of sense of the node). But each node in ngraph must have one output at least.
|
||||
// The port descriptors are automatically created in constructor. We manually clean output ports.
|
||||
@ -80,7 +80,7 @@ ExpressionPtr LinearIR::ExpressionFactory::create(const std::shared_ptr<ov::Node
|
||||
const std::shared_ptr<ov::Model>& model) {
|
||||
OPENVINO_ASSERT(!ov::is_type<op::LoopBase>(n), "Default expression builder doesn't support LoopBegin and LoopEnd");
|
||||
// Note: ctor of shared_ptr isn't friend class for Expression
|
||||
auto expr = std::make_shared<Expression>(Expression(n));
|
||||
auto expr = std::shared_ptr<Expression>(new Expression(n));
|
||||
create_expression_inputs(linear_ir, expr);
|
||||
create_expression_outputs(expr);
|
||||
expr->validate();
|
||||
@ -97,7 +97,7 @@ ExpressionPtr LinearIR::ExpressionFactory::create(const std::shared_ptr<op::Loop
|
||||
}
|
||||
|
||||
ExpressionPtr LinearIR::ExpressionFactory::create(const std::shared_ptr<op::LoopEnd>& n, const std::vector<PortConnectorPtr>& inputs) {
|
||||
auto expr = std::make_shared<Expression>(Expression(n));
|
||||
auto expr = std::shared_ptr<Expression>(new Expression(n));
|
||||
expr->m_input_port_descriptors.resize(inputs.size(), nullptr);
|
||||
for (size_t i = 0; i < inputs.size() - 1; ++i) {
|
||||
expr->m_input_port_descriptors[i] = std::make_shared<PortDescriptor>();
|
||||
@ -117,7 +117,7 @@ ExpressionPtr LinearIR::ExpressionFactory::create(const std::shared_ptr<ov::Node
|
||||
OPENVINO_ASSERT(!ov::is_type<ov::op::v0::Parameter>(n) &&
|
||||
!ov::is_type<ov::op::v0::Result>(n),
|
||||
"Expression builder with inputs doesn't support Result and Parameter");
|
||||
auto expr = std::make_shared<Expression>(Expression(n));
|
||||
auto expr = std::shared_ptr<Expression>(new Expression(n));
|
||||
init_expression_inputs(expr, inputs);
|
||||
create_expression_outputs(expr);
|
||||
expr->validate();
|
||||
|
@ -14,26 +14,32 @@ namespace lowered {
|
||||
ExpressionPort::ExpressionPort(const std::shared_ptr<Expression>& expr, Type type, size_t port)
|
||||
: m_expr(expr), m_type(type), m_port_index(port) {}
|
||||
|
||||
std::shared_ptr<Expression> ExpressionPort::get_expr() const {
|
||||
const auto expr_ptr = m_expr.lock();
|
||||
OPENVINO_ASSERT(expr_ptr != nullptr, "ExpressionPort has invalid expression pointer");
|
||||
return expr_ptr;
|
||||
}
|
||||
|
||||
const PortDescriptorPtr& ExpressionPort::get_descriptor_ptr() const {
|
||||
const auto& descs = m_type == Type::Input ? m_expr->m_input_port_descriptors
|
||||
: m_expr->m_output_port_descriptors;
|
||||
const auto& descs = m_type == Type::Input ? get_expr()->m_input_port_descriptors
|
||||
: get_expr()->m_output_port_descriptors;
|
||||
OPENVINO_ASSERT(m_port_index < descs.size(), "Incorrect index of port");
|
||||
return descs[m_port_index];
|
||||
}
|
||||
|
||||
const std::shared_ptr<PortConnector>& ExpressionPort::get_port_connector_ptr() const {
|
||||
const auto& connectors = m_type == Type::Input ? m_expr->m_input_port_connectors
|
||||
: m_expr->m_output_port_connectors;
|
||||
const auto& connectors = m_type == Type::Input ? get_expr()->m_input_port_connectors
|
||||
: get_expr()->m_output_port_connectors;
|
||||
OPENVINO_ASSERT(m_port_index < connectors.size(), "Incorrect index of port");
|
||||
return connectors[m_port_index];
|
||||
}
|
||||
|
||||
std::set<ExpressionPort> ExpressionPort::get_connected_ports() const {
|
||||
if (ExpressionPort::m_type == Type::Input) {
|
||||
return { m_expr->m_input_port_connectors[m_port_index]->get_source() };
|
||||
return { get_expr()->m_input_port_connectors[m_port_index]->get_source() };
|
||||
}
|
||||
if (ExpressionPort::m_type == Type::Output) {
|
||||
return m_expr->m_output_port_connectors[m_port_index]->get_consumers();
|
||||
return get_expr()->m_output_port_connectors[m_port_index]->get_consumers();
|
||||
}
|
||||
OPENVINO_THROW("ExpressionPort supports only Input and Output types");
|
||||
}
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/op/generate_proposals.hpp"
|
||||
#include "openvino/op/op.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace op {
|
||||
|
@ -4,10 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/op/util/multiclass_nms_base.hpp"
|
||||
#include "openvino/opsets/opset9.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace op {
|
||||
|
@ -6,10 +6,10 @@
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/core/coordinate_diff.hpp"
|
||||
#include "openvino/op/op.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace op {
|
||||
|
@ -7,10 +7,10 @@
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/op/op.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace op {
|
||||
|
@ -7,12 +7,13 @@
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <openvino/op/convert.hpp>
|
||||
#include <openvino/op/parameter.hpp>
|
||||
#include <string>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/op/convert.hpp"
|
||||
#include "openvino/op/parameter.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace op {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
/**
|
||||
* @ingroup ie_transformation_common_api
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,9 +5,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -6,8 +6,9 @@
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,9 +5,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/opsets/opset1.hpp>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/opsets/opset1.hpp"
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
using P2Btype = std::unordered_map<std::shared_ptr<ov::opset1::Parameter>, std::unordered_set<ov::label_t>>;
|
||||
|
||||
|
@ -5,8 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,8 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,8 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/pass.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/pass.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
/**
|
||||
* @ingroup ie_transformation_common_api
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,8 +5,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -6,8 +6,9 @@
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,9 +5,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/pass.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/pass.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <utility>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/pass.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/pass.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/core/model.hpp>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pass.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/core/model.hpp"
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pass.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <openvino/pass/graph_rewrite.hpp>
|
||||
#include <openvino/pass/pattern/matcher.hpp>
|
||||
#include <transformations_visibility.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "openvino/pass/graph_rewrite.hpp"
|
||||
#include "openvino/pass/pattern/matcher.hpp"
|
||||
#include "transformations_visibility.hpp"
|
||||
|
||||
namespace ov {
|
||||
namespace pass {
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user