Skip to content

Commit

Permalink
[DOCS] Fixing formatting and reference issues (openvinotoolkit#23405)
Browse files Browse the repository at this point in the history
Fixing formatting and reference issues in docs.

Porting: openvinotoolkit#23333

Fixing directives for linking and cross-reference.

Porting: openvinotoolkit#23300
  • Loading branch information
sgolebiewski-intel authored and vishniakov-nikolai committed Mar 13, 2024
1 parent ea1c6b0 commit fa695ec
Show file tree
Hide file tree
Showing 48 changed files with 535 additions and 468 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.

This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Model Preparation <../../../../openvino-workflow/model-preparation>` article.
This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Model Preparation <../../../../openvino-workflow/model-preparation>` article.

Model conversion API is represented by ``convert_model()`` method in openvino.tools.mo namespace. ``convert_model()`` is compatible with types from openvino.runtime, like PartialShape, Layout, Type, etc.

Expand All @@ -32,8 +32,8 @@ Example of converting a PyTorch model directly from memory:
The following types are supported as an input model for ``convert_model()``:

* PyTorch - ``torch.nn.Module``, ``torch.jit.ScriptModule``, ``torch.jit.ScriptFunction``. Refer to the :doc:`Converting a PyTorch Model<[legacy]-supported-model-formats/[legacy]-convert-pytorch>` article for more details.
* TensorFlow / TensorFlow 2 / Keras - ``tf.keras.Model``, ``tf.keras.layers.Layer``, ``tf.compat.v1.Graph``, ``tf.compat.v1.GraphDef``, ``tf.Module``, ``tf.function``, ``tf.compat.v1.session``, ``tf.train.checkpoint``. Refer to the :doc:`Converting a TensorFlow Model<[legacy]-supported-model-formats/[legacy]-convert-tensorflow>` article for more details.
* PyTorch - ``torch.nn.Module``, ``torch.jit.ScriptModule``, ``torch.jit.ScriptFunction``. Refer to the :doc:`Converting a PyTorch Model <[legacy]-supported-model-formats/[legacy]-convert-pytorch>` article for more details.
* TensorFlow / TensorFlow 2 / Keras - ``tf.keras.Model``, ``tf.keras.layers.Layer``, ``tf.compat.v1.Graph``, ``tf.compat.v1.GraphDef``, ``tf.Module``, ``tf.function``, ``tf.compat.v1.session``, ``tf.train.checkpoint``. Refer to the :doc:`Converting a TensorFlow Model <[legacy]-supported-model-formats/[legacy]-convert-tensorflow>` article for more details.

``convert_model()`` accepts all parameters available in the MO command-line tool. Parameters can be specified by Python classes or string analogs, similar to the command-line tool.

Expand Down Expand Up @@ -64,7 +64,7 @@ Example of using a tuple in the ``input`` parameter to cut a model:
ov_model = convert_model(model, input=("input_name", [3], np.float32))
For complex cases, when a value needs to be set in the ``input`` parameter, the ``InputCutInfo`` class can be used. ``InputCutInfo`` accepts four parameters: ``name``, ``shape``, ``type``, and ``value``.
For complex cases, when a value needs to be set in the ``input`` parameter, the ``InputCutInfo`` class can be used. ``InputCutInfo`` accepts four parameters: ``name``, ``shape``, ``type``, and ``value``.

``InputCutInfo("input_name", [3], np.float32, [0.5, 2.1, 3.4])`` is equivalent of ``InputCutInfo(name="input_name", shape=[3], type=np.float32, value=[0.5, 2.1, 3.4])``.

Expand All @@ -85,11 +85,11 @@ Example of using ``InputCutInfo`` to freeze an input with value:
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.
Parameters supporting ``list``:
Parameters supporting ``list``:

* input
* input_shape
* layout
* layout
* source_layout
* dest_layout
* mean_values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Converting a TensorFlow GNMT Model


.. meta::
:description: Learn how to convert a GNMT model
:description: Learn how to convert a GNMT model
from TensorFlow to the OpenVINO Intermediate Representation.

.. danger::

The code described here has been **deprecated!** Do not use it to avoid working with a legacy solution. It will be kept for some time to ensure backwards compatibility, but **you should not use** it in contemporary applications.

This guide describes a deprecated conversion method. The guide on the new and recommended method can be found in the :doc:`Python tutorials <../../../../../../learn-openvino/interactive-tutorials-python>`.

This tutorial explains how to convert Google Neural Machine Translation (GNMT) model to the Intermediate Representation (IR).

There are several public versions of TensorFlow GNMT model implementation available on GitHub. This tutorial explains how to convert the GNMT model from the `TensorFlow Neural Machine Translation (NMT) repository <https://github.com/tensorflow/nmt>`__ to the IR.
Expand All @@ -26,7 +26,7 @@ Before converting the model, you need to create a patch file for the repository.
1. Go to a writable directory and create a ``GNMT_inference.patch`` file.
2. Copy the following diff code to the file:

.. code-block:: cpp
.. code-block:: py
diff --git a/nmt/inference.py b/nmt/inference.py
index 2cbef07..e185490 100644
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ For other examples of transformations with points, refer to the
Generic Front Phase Transformations Enabled with Transformations Configuration File
###################################################################################

This type of transformation works similarly to the :ref:`Generic Front Phase Transformations <generic_front_phase_transformations)`
This type of transformation works similarly to the :ref:`Generic Front Phase Transformations <generic_front_phase_transformations>`
but require a JSON configuration file to enable it similarly to
:ref:`Node Name Pattern Front Phase Transformations <node_name_pattern_front_phase_transformations>` and
:ref:`Front Phase Transformations Using Start and End Points <start_end_points_front_phase_transformations>`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,9 @@ The Model Hosting components install the OpenVINO™ Security Add-on Runtime Doc
How to Use the OpenVINO™ Security Add-on
########################################
This section requires interactions between the Model Developer/Independent Software vendor and the User. All roles must complete all applicable :ref:`set up steps <setup-host>` and :ref:`installation steps <ovsa-install>` before beginning this section.
This section requires interactions between the Model Developer/Independent Software vendor and the User. All roles must complete all applicable :ref:`set up steps <setup_host>` and :ref:`installation steps <install_ovsa>` before beginning this section.
This document uses the :ref:`face-detection-retail-0004 <../../omz_models_model_face_detection_retail_0044>` model as an example.
This document uses the :doc:`face-detection-retail-0004 <../../omz_models_model_face_detection_retail_0044>` model as an example.
The following figure describes the interactions between the Model Developer, Independent Software Vendor, and User.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ Example Kernel
Debugging Tips
##############

**Using ``printf`` in the OpenCL™ Kernels**.
**Using** ``printf`` **in the OpenCL™ Kernels**.

To debug the specific values, use ``printf`` in your kernels.
However, be careful not to output excessively, which
could generate too much data. The ``printf`` output is typical, so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Custom OpenVINO Operations
custom operations to support models with operations
not supported by OpenVINO.

OpenVINO™ Extension API allows you to register custom operations to support models with operations which OpenVINO™ does not support out-of-the-box. This capability requires writing code in C++, so if you are using Python to develop your application you need to build a separate shared library implemented in C++ first and load it in Python using ``add_extension`` API. Please refer to :ref:`Create library with extensions <create_library_with_extensions>` for more details on library creation and usage. The remining part of this document describes how to implement an operation class.
OpenVINO™ Extension API allows you to register custom operations to support models with operations which OpenVINO™ does not support out-of-the-box. This capability requires writing code in C++, so if you are using Python to develop your application you need to build a separate shared library implemented in C++ first and load it in Python using ``add_extension`` API. Please refer to :ref:`Create library with extensions <create_a_library_with_extensions>` for more details on library creation and usage. The remaining part of this document describes how to implement an operation class.

Operation Class
###############
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Main transformations are the majority of low precision transformations. Transfor
* :doc:`MultiplyPartialTransformation <step3-main/arithmetic/multiply-partial>`
* :doc:`MVNTransformation <step3-main/normalization/mvn>`
* :doc:`NormalizeL2Transformation <step3-main/normalization/normalize-l2>`
* :doc:`PadTransformation<step3-main/movement/pad>`
* :doc:`PadTransformation <step3-main/movement/pad>`
* :doc:`PReluTransformation <step3-main/activation/prelu>`
* :doc:`ReduceMaxTransformation <step3-main/reduction/reduce-max>`
* :doc:`ReduceMeanTransformation <step3-main/reduction/reduce-mean>`
Expand Down

This file was deleted.

Loading

0 comments on commit fa695ec

Please sign in to comment.