OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[DOCS] Updating Transformations API docs (#26465)
Sebastian Golebiewski1b98e2d639e7
diff --git a/docs/articles_en/assets/snippets/ov_matcher_pass.py b/docs/articles_en/assets/snippets/ov_matcher_pass.pyindex 96865177cf6..62390bcf932 100644--- a/docs/articles_en/assets/snippets/ov_matcher_pass.py+++ b/docs/articles_en/assets/snippets/ov_matcher_pass.py@@ -1,13 +1,13 @@# ! [matcher_pass:ov_matcher_pass_py]'''``MatcherPass`` is used for pattern-based transformations.-To create transformation you need:+To create transformation, you need to:-1. Create a pattern-2. Implement a callback-3. Register the pattern and Matcher+1. Create a pattern.+2. Implement a callback.+3. Register the pattern and ``Matcher``.-In the next example we define transformation that searches for ``Relu`` layer and inserts after it another+The next example defines transformation that searches for the ``Relu`` layer and inserts after it another``Relu`` layer.'''@@ -35,7 +35,7 @@ class PatternReplacement(MatcherPass):'''-After running this code you will see the next:+After running this code, you will see the next:model ops :parameter@@ -48,9 +48,9 @@ resultrelunew_relu-In oder to run this script you need to export PYTHONPATH as the path to binary OpenVINO python models.+In order to run this script, you need to export PYTHONPATH as the path to binary OpenVINO python models.'''-from openvino.runtime.passes import Manager, GraphRewrite, BackwardGraphRewrite, Serialize+from openvino.runtime.passes import Managerfrom openvino import Model, PartialShapefrom openvino.runtime import opset13 as opsfrom openvino.runtime.passes import ModelPass, Matcher, MatcherPass, WrapTypediff --git a/docs/articles_en/assets/snippets/ov_model_pass.py b/docs/articles_en/assets/snippets/ov_model_pass.pyindex 6ee6dde418c..f5860dcc755 100644--- a/docs/articles_en/assets/snippets/ov_model_pass.py+++ b/docs/articles_en/assets/snippets/ov_model_pass.py@@ -1,10 +1,10 @@# ! [model_pass:ov_model_pass_py]'''-``ModelPass`` can be used as base class for transformation classes that take entire ``Model`` and proceed it.-To create transformation you need:-1. Define class with ``ModelPass`` as a parent-2. Redefine run_on_model method that will receive ``Model`` as an argument+``ModelPass`` can be used as a base class for transformation classes that take entire ``Model`` and proceed with it.+To create transformation, you need to:+1. Define a class with ``ModelPass`` as a parent.+2. Redefine the run_on_model method that will receive ``Model`` as an argument.'''from openvino.runtime.passes import ModelPass@@ -20,10 +20,10 @@ class MyModelPass(ModelPass):'''-In this example we define transformation that prints all model operation names.+This example defines transformation that prints all model operation names.The next example shows ModelPass-based transformation usage.-We create Model with Relu, Parameter and Result nodes. After running this code you will see names of these three nodes.-In oder to run this script you need to export PYTHONPATH as the path to binary OpenVINO python models.+You create ``Model`` with ``Relu``, ``Parameter`` and ``Result`` nodes. After running this code, you will see the names of the nodes.+In order to run this script, you need to export PYTHONPATH as the path to binary OpenVINO python models.'''from openvino.runtime.passes import Manager, GraphRewrite, BackwardGraphRewrite, Serialize