* transformations to rst * fix snippets * fix links * add sphinx directive * change img path * fix snippet path * fix link * fix anchor * fix transformation image * fix reference * fix reference anchor * fix matcher pass link
1.2 KiB
OpenVINO Model Pass
@sphinxdirective
:ref:`ov::pass::ModelPass <doxid-classov_1_1pass_1_1_model_pass>``` is used for transformations that take entire :ref:`ov::Model <doxid-classov_1_1_model>``` as an input and process it.
Template for ModelPass transformation class
.. doxygensnippet:: docs/snippets/template_model_transformation.hpp :language: cpp :fragment: [model_pass:template_transformation_hpp]
.. doxygensnippet:: docs/snippets/template_model_transformation.cpp :language: cpp :fragment: [model_pass:template_transformation_cpp]
Using :ref:`ov::pass::ModelPass <doxid-classov_1_1pass_1_1_model_pass>```, you need to override the run_on_modelmethod where you will write the transformation code. Return value istrueif the original model has changed during transformation (new operation was added, or operations replacement was made, or node attributes were changed); otherwise, it isfalse. Also :ref:ov::pass::ModelPass <doxid-classov_1_1pass_1_1_model_pass>``` based transformations can be executed via ``:ref:ov::pass::Manager <doxid-classov_1_1pass_1_1_manager>```.
See Also ########
- :doc:
OpenVINO™ Transformations <openvino_docs_transformations>
@endsphinxdirective