Skip to content

Commit

Permalink
[DOCS] review for 22356 and 22410 (openvinotoolkit#22466)
Browse files Browse the repository at this point in the history
relates to:
openvinotoolkit#22410
openvinotoolkit#22356

---------

Co-authored-by: Tatiana Savina <[email protected]>
  • Loading branch information
kblaszczak-intel and tsavina authored Feb 8, 2024
1 parent 77a0b91 commit 1886fc6
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 273 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Assign


.. meta::
:description: Learn about Assign-6 - an infrastructure operation, which
:description: Learn about Assign-6 - an infrastructure operation, which
can be performed on a single input tensor to set a value to variable_id.

**Versioned name**: *Assign-6*
Expand All @@ -16,15 +16,18 @@ Assign

**Detailed description**:

ReadValue, Assign and Variable define a coherent mechanism for reading, writing and storing a memory buffer between inference calls.
More details can be found on :doc:`StateAPI<openvino_docs_OV_UG_stateful_models_intro>` documentation page.
ReadValue, Assign, and Variable define a coherent mechanism for reading, writing and
storing a memory buffer between inference calls. More details can be found on the
:doc:`StateAPI<openvino_docs_OV_UG_stateful_models_intro>` documentation page.

*Assign* operation sets an input value to the ``variable_id`` variable. This value will be read by *ReadValue* operation on next inference call if variable was not reset.
The operation checks that the shape and type specified in ``variable_id`` variable extend (relax)
the shape and the type inferred from the 1st input and returns an error otherwise, e.g. if the type in the variable is specified
as dynamic, it means that any type for 1st input is allowed but if it is specified as f32, only f32 type is allowed.
*Assign* sets an input value to the ``variable_id`` variable. This value will be read
by the *ReadValue* operation on the next inference call if it has not been reset.
The operation checks if the shape and type specified in ``variable_id`` extend (relax)
the shape and type inferred from the 1st input. If not, it returns an error. For example,
if the type in the variable is specified as dynamic, it means that any type for 1st
input is allowed but if it is specified as f32, only f32 type is allowed.

It is expected only one pair of ReadValue, Assign operations for each Variable in the model.
Only one pair of ReadValue and Assign operations is expected for each Variable in the model.

**Attributes**:

Expand All @@ -47,7 +50,7 @@ It is expected only one pair of ReadValue, Assign operations for each Variable i

.. code-block:: xml
:force:
<layer ... type="Assign" ...>
<data variable_id="lstm_state_1"/>
<input>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ReadValue


.. meta::
:description: Learn about ReadValue-6 - an infrastructure operation, which
:description: Learn about ReadValue-6 - an infrastructure operation, which
can be performed on a single input tensor or without input tensors
to return the value of variable_id.

Expand All @@ -17,22 +17,25 @@ ReadValue

**Detailed description**:

ReadValue, Assign and Variable define a coherent mechanism for reading, writing and storing some memory buffer between inference calls.
More details can be found on :doc:`StateAPI<openvino_docs_OV_UG_stateful_models_intro>` documentation page.
*ReadValue*, *Assign*, and *Variable* define a coherent mechanism for reading, writing,
and storing some memory buffer between inference calls. More details can be found on the
:doc:`StateAPI<openvino_docs_OV_UG_stateful_models_intro>` documentation page.

If 1st input is provided and this is the first inference or reset was called,
If the 1st input is provided and this is the first inference or reset has been called,
*ReadValue* returns the value from the 1st input.

If 1st input is not provided and this is the first inference or reset was called,
If the 1st input is not provided and this is the first inference or reset has been called,
*ReadValue* returns the tensor with the ``variable_shape`` and ``variable_type`` and zero values.

In all other cases *ReadValue* returns value from the corresponding ``variable_id`` Variable.
In all other cases *ReadValue* returns the value from the corresponding ``variable_id`` variable.

If the 1st input was provided, the operation checks that ``variable_shape`` and ``variable_type`` extend (relax)
the shape and the type inferred from the 1st input and returns an error otherwise, e.g. if ``variable_type`` is specified
as dynamic, it means that any type for 1st input is allowed but if it is specified as f32, only f32 type is allowed.
If the 1st input has been provided, the operation checks if ``variable_shape`` and ``variable_type``
extend (relax) the shape and type inferred from the 1st input. If not, it returns an error.
For example, if ``variable_type`` is specified as dynamic, it means that any type for 1st input
is allowed but if it is specified as f32, only f32 type is allowed.

Only one pair of ReadValue and Assign operations is expected for each Variable in the model.

It is expected only one pair of ReadValue, Assign operations for each Variable in the model.

**Attributes**:

Expand Down Expand Up @@ -90,4 +93,4 @@ It is expected only one pair of ReadValue, Assign operations for each Variable i
</output>
</layer>
Loading

0 comments on commit 1886fc6

Please sign in to comment.