[Docs][PyOV] update python snippets (#19367)
* [Docs][PyOV] update python snippets * first snippet * Fix samples debug * Fix linter * part1 * Fix speech sample * update model state snippet * add serialize * add temp dir * CPU snippets update (#134) * snippets CPU 1/6 * snippets CPU 2/6 * snippets CPU 3/6 * snippets CPU 4/6 * snippets CPU 5/6 * snippets CPU 6/6 * make module TODO: REMEMBER ABOUT EXPORTING PYTONPATH ON CIs ETC * Add static model creation in snippets for CPU * export_comp_model done * leftovers * apply comments * apply comments -- properties * small fixes * rempve debug info * return IENetwork instead of Function * apply comments * revert precision change in common snippets * update opset * [PyOV] Edit docs for the rest of plugins (#136) * modify main.py * GNA snippets * GPU snippets * AUTO snippets * MULTI snippets * HETERO snippets * Added properties * update gna * more samples * Update docs/OV_Runtime_UG/model_state_intro.md * Update docs/OV_Runtime_UG/model_state_intro.md * attempt1 fix ci * new approach to test * temporary remove some files from run * revert cmake changes * fix ci * fix snippet * fix py_exclusive snippet * fix preprocessing snippet * clean-up main * remove numpy installation in gha * check for GPU * add logger * iexclude main * main update * temp * Temp2 * Temp2 * temp * Revert temp * add property execution devices * hide output from samples --------- Co-authored-by: p-wysocki <przemyslaw.wysocki@intel.com> Co-authored-by: Jan Iwaszkiewicz <jan.iwaszkiewicz@intel.com> Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>
This commit is contained in:
68 files changed
+1223
-892
No files matched your search
@@ -20,7 +20,7 @@ nGraph API
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ngraph.py
|
||||
.. doxygensnippet:: docs/snippets/ngraph_snippet.py
|
||||
:language: Python
|
||||
:fragment: ngraph:graph
|
||||
|
||||
|
||||
@@ -163,9 +163,21 @@ Example of Creating Model OpenVINO API
|
||||
|
||||
In the following example, the ``SinkVector`` is used to create the ``ov::Model``. For a model with states, except inputs and outputs, the ``Assign`` nodes should also point to the ``Model`` to avoid deleting it during graph transformations. Use the constructor to do it, as shown in the example, or with the special ``add_sinks(const SinkVector& sinks)`` method. After deleting the node from the graph with the ``delete_sink()`` method, a sink can be deleted from ``ov::Model``.
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_model_with_state_infer.cpp
|
||||
:language: cpp
|
||||
:fragment: [model_create]
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_model_with_state_infer.cpp
|
||||
:language: cpp
|
||||
:fragment: [model_create]
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_model_with_state_infer.py
|
||||
:language: python
|
||||
:fragment: ov:model_create
|
||||
|
||||
.. _openvino-state-api:
|
||||
|
||||
@@ -189,10 +201,22 @@ Based on the IR from the previous section, the example below demonstrates infere
|
||||
|
||||
One infer request and one thread will be used in this example. Using several threads is possible if there are several independent sequences. Then, each sequence can be processed in its own infer request. Inference of one sequence in several infer requests is not recommended. In one infer request, a state will be saved automatically between inferences, but if the first step is done in one infer request and the second in another, a state should be set in a new infer request manually (using the ``ov::IVariableState::set_state`` method).
|
||||
|
||||
.. tab-set::
|
||||
|
||||
.. tab-item:: C++
|
||||
:sync: cpp
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_model_with_state_infer.cpp
|
||||
:language: cpp
|
||||
:fragment: [part1]
|
||||
|
||||
.. tab-item:: Python
|
||||
:sync: py
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_model_with_state_infer.py
|
||||
:language: python
|
||||
:fragment: ov:part1
|
||||
|
||||
.. doxygensnippet:: docs/snippets/ov_model_with_state_infer.cpp
|
||||
:language: cpp
|
||||
:fragment: [part1]
|
||||
|
||||
|
||||
For more elaborate examples demonstrating how to work with models with states,
|
||||
|
||||
Reference in new issue
Block a user