Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Spec] Identity operation #26718

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PiotrKrzem marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Identity
========


.. meta::
:description: Learn about Identity-16 - a simple operation that forwards the input to the output.

**Versioned name**: *Identity-16*

**Category**: *Activation*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activation makes sense, but wouldn't it fit better "Infrastructure" category?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was even considering 'internal' myself, I am not sure

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Internal" is a category of OpenVINO operations which are not a part of public API, so it wouldn't be the right choice. "Infrastracture" is also an option, but "Identity" also called "Linear" is described as a type of activation function in many articles, and this is aligned with detailed op description below. As the category here doesn't affect the op logic or compatibility, in my opinion it's ok leave it as is (but always can be moved).


**Short description**: The *Identity* operation forwards the input to the output.

**Detailed description**: The *Identity* operation generates a new tensor that mirrors the input tensor in shape, data type, and content, effectively implementing the linear activation function f(x) = x.
If the input and output tensor data address is the same, input is returned as output instead.

**Input**:

* **1**: `input` - A tensor of any shape and type `T`. **Required.**

**Output**:

* **1**: `output` - A tensor with the same shape and type `T` as the input, containing the same data as the input.

**Types**

* **T**: any supported data type.

*Example 1: 2D input matrix.*

.. code-block:: xml
:force:

<layer ... name="Identity" type="Identity">
<data/>
<input>
<port id="0" precision="FP32">
<dim>3</dim>
<dim>3</dim>
</port>
</input>
<output>
<port id="1" precision="FP32" names="Identity:16">
<dim>3</dim>
<dim>3</dim>
</port>
</output>
</layer>
Loading