[DOCS] Fix for xml comments + ScatterUpdate Inputs for master (#22623)

* Fixed xml comments throughout the docs.
* Fixed ScatterUpdate Inputs paragraph.
This commit is contained in:
Maciej Smyk 2024-02-06 14:06:58 +01:00 committed by GitHub
parent e86671bbed
commit 6c52c18d1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
83 changed files with 952 additions and 952 deletions

View File

@ -5,7 +5,7 @@ Swish
.. meta::
:description: Learn about Swish-4 - an element-wise, activation operation, which
:description: Learn about Swish-4 - an element-wise, activation operation, which
can be performed on a single tensor in OpenVINO.
**Versioned name**: *Swish-4*
@ -55,7 +55,7 @@ Example: Second input ``beta`` provided
<dim>256</dim>
<dim>56</dim>
</port>
<port id="1"> < !-- beta value: 2.0 -->
<port id="1"> <!-- beta value: 2.0 -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ CumSum
.. meta::
:description: Learn about CumSum-3 - an element-wise, arithmetic operation, which
:description: Learn about CumSum-3 - an element-wise, arithmetic operation, which
can be performed on a single tensor in OpenVINO.
**Versioned name**: *CumSum-3*
@ -24,7 +24,7 @@ To perform the summation in the opposite direction of the axis, set reverse attr
* **Description**: If the attribute is set to ``true``, then exclusive sums are returned, the ``j-th`` element is not included in the ``j-th`` sum. Otherwise, the inclusive sum of the first ``j`` elements for the ``j-th`` element is calculated.
* **Range of values**:
* ``false`` - include the top element
* ``true`` - do not include the top element
* **Type**: ``boolean``
@ -35,7 +35,7 @@ To perform the summation in the opposite direction of the axis, set reverse attr
* **Description**: If set to ``true`` will perform the sums in reverse direction.
* **Range of values**:
* ``false`` - do not perform sums in reverse direction
* ``true`` - perform sums in reverse direction
* **Type**: ``boolean``
@ -63,16 +63,16 @@ To perform the summation in the opposite direction of the axis, set reverse attr
.. code-block:: xml
:force:
<layer ... type="CumSum" exclusive="0" reverse="0">
<input>
<port id="0"> < !-- input value is: [1., 2., 3., 4., 5.] -->
<port id="0"> <!-- input value is: [1., 2., 3., 4., 5.] -->
<dim>5</dim>
</port>
<port id="1"/> < !-- axis value is: 0 -->
<port id="1"/> <!-- axis value is: 0 -->
</input>
<output>
<port id="2"> < !-- output value is: [1., 3., 6., 10., 15.] -->
<port id="2"> <!-- output value is: [1., 3., 6., 10., 15.] -->
<dim>5</dim>
</port>
</output>
@ -82,16 +82,16 @@ To perform the summation in the opposite direction of the axis, set reverse attr
.. code-block:: xml
:force:
<layer ... type="CumSum" exclusive="1" reverse="0">
<input>
<port id="0"> < !-- input value is: [1., 2., 3., 4., 5.] -->
<port id="0"> <!-- input value is: [1., 2., 3., 4., 5.] -->
<dim>5</dim>
</port>
<port id="1"/> < !-- axis value is: 0 -->
<port id="1"/> <!-- axis value is: 0 -->
</input>
<output>
<port id="2"> < !-- output value is: [0., 1., 3., 6., 10.] -->
<port id="2"> <!-- output value is: [0., 1., 3., 6., 10.] -->
<dim>5</dim>
</port>
</output>
@ -101,16 +101,16 @@ To perform the summation in the opposite direction of the axis, set reverse attr
.. code-block:: xml
:force:
<layer ... type="CumSum" exclusive="0" reverse="1">
<input>
<port id="0"> < !-- input value is: [1., 2., 3., 4., 5.] -->
<port id="0"> <!-- input value is: [1., 2., 3., 4., 5.] -->
<dim>5</dim>
</port>
<port id="1"/> < !-- axis value is: 0 -->
<port id="1"/> <!-- axis value is: 0 -->
</input>
<output>
<port id="2"> < !-- output value is: [15., 14., 12., 9., 5.] -->
<port id="2"> <!-- output value is: [15., 14., 12., 9., 5.] -->
<dim>5</dim>
</port>
</output>
@ -120,7 +120,7 @@ To perform the summation in the opposite direction of the axis, set reverse attr
.. code-block:: xml
:force:
<layer ... type="CumSum" exclusive="1" reverse="1">
<input>
<port id="0"> < -- input value is: [1., 2., 3., 4., 5.] -->

View File

@ -5,7 +5,7 @@ Sqrt
.. meta::
:description: Learn about Sqrt-1 - an element-wise, arithmetic operation, which
:description: Learn about Sqrt-1 - an element-wise, arithmetic operation, which
can be performed on a single tensor in OpenVINO.
**Versioned name**: *Sqrt-1*
@ -48,12 +48,12 @@ Sqrt
<layer ... type="Sqrt">
<input>
<port id="0">
<dim>4</dim> < !-- float input values: [4.0, 7.0, 9.0, 10.0] -->
<dim>4</dim> <!-- float input values: [4.0, 7.0, 9.0, 10.0] -->
</port>
</input>
<output>
<port id="1">
<dim>4</dim> < !-- float output values: [2.0, 2.6457512, 3.0, 3.1622777] -->
<dim>4</dim> <!-- float output values: [2.0, 2.6457512, 3.0, 3.1622777] -->
</port>
</output>
</layer>
@ -66,12 +66,12 @@ Sqrt
<layer ... type="Sqrt">
<input>
<port id="0">
<dim>4</dim> < !-- int input values: [4, 7, 9, 10] -->
<dim>4</dim> <!-- int input values: [4, 7, 9, 10] -->
</port>
</input>
<output>
<port id="1">
<dim>4</dim> < !-- int output values: [2, 3, 3, 3] -->
<dim>4</dim> <!-- int output values: [2, 3, 3, 3] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ IsFinite
.. meta::
:description: Learn about IsFinite-10 - an element-wise, comparison operation, which
:description: Learn about IsFinite-10 - an element-wise, comparison operation, which
can be performed on a single tensor in OpenVINO.
**Versioned name**: *IsFinite-10*
@ -64,12 +64,12 @@ IsFinite
<layer ... type="IsFinite">
<input>
<port id="0" precision="FP32">
<dim>4</dim> < !-- Input value is: [NaN, 2.1, 3.7, Inf] -->
<dim>4</dim> <!-- Input value is: [NaN, 2.1, 3.7, Inf] -->
</port>
</input>
<output>
<port id="1" precision="BOOL">
<dim>4</dim> < !-- Output value is: [False, True, True, False] -->
<dim>4</dim> <!-- Output value is: [False, True, True, False] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ Select
.. meta::
:description: Learn about Select-1 - an element-wise, condition operation, which
:description: Learn about Select-1 - an element-wise, condition operation, which
can be performed on three given tensors in OpenVINO.
**Versioned name**: *Select-1*
@ -58,21 +58,21 @@ Select
<layer ... type="Select">
<input>
<port id="0"> < !-- cond value is: [[false, false], [true, false], [true, true]] -->
<port id="0"> <!-- cond value is: [[false, false], [true, false], [true, true]] -->
<dim>3</dim>
<dim>2</dim>
</port>
<port id="1"> < !-- then value is: [[-1, 0], [1, 2], [3, 4]] -->
<port id="1"> <!-- then value is: [[-1, 0], [1, 2], [3, 4]] -->
<dim>3</dim>
<dim>2</dim>
</port>
<port id="2"> < !-- else value is: [[11, 10], [9, 8], [7, 6]] -->
<port id="2"> <!-- else value is: [[11, 10], [9, 8], [7, 6]] -->
<dim>3</dim>
<dim>2</dim>
</port>
</input>
<output>
<port id="1"> < !-- output value is: [[11, 10], [1, 8], [3, 4]] -->
<port id="1"> <!-- output value is: [[11, 10], [1, 8], [3, 4]] -->
<dim>3</dim>
<dim>2</dim>
</port>

View File

@ -5,7 +5,7 @@ ConvolutionBackpropData
.. meta::
:description: Learn about ConvolutionBackpropData-1 - a 1D, 2D or 3D convolution operation, which
:description: Learn about ConvolutionBackpropData-1 - a 1D, 2D or 3D convolution operation, which
can be performed on input and kernel tensors in OpenVINO.
**Versioned name**: *ConvolutionBackpropData-1*
@ -24,11 +24,11 @@ When output shape is specified as an input tensor ``output_shape`` then it speci
.. code-block:: xml
:force:
if auto_pads != None:
pads_begin[i] = 0
pads_end[i] = 0
Y_i = stride[i] * (X_i - 1) + ((K_i - 1) * dilations[i] + 1) - pads_begin[i] - pads_end[i] + output_padding[i]
where ``K_i`` filter kernel dimension along spatial axis ``i``.
@ -37,7 +37,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
.. code-block:: xml
:force:
total_padding[i] = stride[i] * (X_i - 1) + ((K_i - 1) * dilations[i] + 1) - output_shape[i] + output_padding[i]
if auto_pads != SAME_UPPER:
pads_begin[i] = total_padding[i] // 2
@ -81,7 +81,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
* *auto_pad*
* **Description**: *auto_pad* has the same definition as *auto_pad* for a regular Convolution but applied in the backward way, for the output tensor.
* *explicit*: use explicit padding values from ``pads_begin`` and ``pads_end``.
* *same_upper* the input is padded to match the output size. In case of odd padding value an extra padding is added at the end.
* *same_lower* the input is padded to match the output size. In case of odd padding value an extra padding is added at the beginning.
@ -105,7 +105,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
* **2**: Convolution kernel tensor of type *T1* and rank 3, 4 or 5. Layout is ``[C_INPUT, C_OUTPUT, Z, Y, X]`` (number of input channels, number of output channels, spatial axes Z, Y, X). Spatial size of the kernel is derived from the shape of this input and aren't specified by any attribute. **Required.**
* **3**: ``output_shape`` is 1D tensor of type *T2* that specifies spatial shape of the output. If specified, *padding amount* is deduced from relation of input and output spatial shapes according to formulas in the description. If not specified, *output shape* is calculated based on the ``pads_begin`` and ``pads_end`` or completely according to ``auto_pad``. **Optional.**
* **Note**: Type of the convolution (1D, 2D or 3D) is derived from the rank of the input tensors and not specified by any attribute:
* 1D convolution (input tensors rank 3) means that there is only one spatial axis X,
* 2D convolution (input tensors rank 4) means that there are two spatial axes Y, X,
* 3D convolution (input tensors rank 5) means that there are three spatial axes Z, Y, X.
@ -125,7 +125,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
.. code-block:: xml
:force:
<layer id="5" name="upsampling_node" type="ConvolutionBackpropData">
<data dilations="1,1" pads_begin="1,1" pads_end="1,1" strides="2,2" output_padding="0,0" auto_pad="explicit"/>
<input>
@ -156,7 +156,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
.. code-block:: xml
:force:
<layer id="5" name="upsampling_node" type="ConvolutionBackpropData">
<data dilations="1,1" pads_begin="0,0" pads_end="0,0" strides="3,3" output_padding="2,2" auto_pad="explicit"/>
<input>
@ -187,7 +187,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
.. code-block:: xml
:force:
<layer id="5" name="upsampling_node" type="ConvolutionBackpropData">
<data dilations="1,1" pads_begin="1,1" pads_end="1,1" strides="1,1" output_padding="0,0" auto_pad="valid"/>
<input>
@ -204,7 +204,7 @@ If ``output_shape`` is specified, ``pads_begin`` and ``pads_end`` are ignored, a
<dim>3</dim>
</port>
<port id="2">
<dim>2</dim> < !-- output_shape value is: [450, 450]-->
<dim>2</dim> <!-- output_shape value is: [450, 450]-->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ PriorBoxClustered
.. meta::
:description: Learn about PriorBoxClustered-1 - an object detection operation,
:description: Learn about PriorBoxClustered-1 - an object detection operation,
which can be performed on two 1D input tensors.
**Versioned name**: *PriorBoxClustered-1*
@ -94,7 +94,7 @@ If *clip* is defined, the coordinates of prior boxes are recalculated with the f
* *step (step_w, step_h)*
* **Description**: *step (step_w, step_h)* is a distance between box centers. For example, *step* equal 85 means that the distance between neighborhood prior boxes centers is 85. If both *step_h* and *step_w* are 0 then they are updated with value of *step*. If after that they are still 0 then they are calculated as input image width(height) divided with first input width(height).
* **Description**: *step (step_w, step_h)* is a distance between box centers. For example, *step* equal 85 means that the distance between neighborhood prior boxes centers is 85. If both *step_h* and *step_w* are 0 then they are updated with value of *step*. If after that they are still 0 then they are calculated as input image width(height) divided with first input width(height).
* **Range of values**: floating-point positive number
* **Type**: ``float``
* **Default value**: 0.0
@ -139,10 +139,10 @@ If *clip* is defined, the coordinates of prior boxes are recalculated with the f
<data clip="false" height="44.0,10.0,30.0,19.0,94.0,32.0,61.0,53.0,17.0" offset="0.5" step="16.0" variance="0.1,0.1,0.2,0.2" width="86.0,13.0,57.0,39.0,68.0,34.0,142.0,50.0,23.0"/>
<input>
<port id="0">
<dim>2</dim> < !-- [10, 19] -->
<dim>2</dim> <!-- [10, 19] -->
</port>
<port id="1">
<dim>2</dim> < !-- [180, 320] -->
<dim>2</dim> <!-- [180, 320] -->
</port>
</input>
<output>

View File

@ -6,7 +6,7 @@ PriorBox
.. meta::
:description: Learn about PriorBox-1 - an object detection operation,
:description: Learn about PriorBox-1 - an object detection operation,
which can be performed on two required input tensors.
**Versioned name**: *PriorBox-1*
@ -22,44 +22,44 @@ PriorBox
1. First calculates *center_x* and *center_y* of prior box:
.. math::
W \equiv Width \quad Of \quad Image \\ H \equiv Height \quad Of \quad Image
* If step equals 0:
.. math::
center_x=(w+0.5) \\ center_y=(h+0.5)
* else:
.. math::
center_x=(w+offset)*step \\ center_y=(h+offset)*step \\ w \subset \left( 0, W \right ) \\ h \subset \left( 0, H \right )
2. Then, for each :math:`s \subset \left( 0, min\_sizes \right )` calculates coordinates of prior boxes:
.. math::
xmin = \frac{\frac{center_x - s}{2}}{W}
.. math::
ymin = \frac{\frac{center_y - s}{2}}{H}
.. math::
xmax = \frac{\frac{center_x + s}{2}}{W}
.. math::
ymin = \frac{\frac{center_y + s}{2}}{H}
3. If *clip* attribute is set to true, each output value is clipped between :math:`\left< 0, 1 \right>`.
@ -186,10 +186,10 @@ PriorBox
<data aspect_ratio="2.0" clip="false" density="" fixed_ratio="" fixed_size="" flip="true" max_size="38.46" min_size="16.0" offset="0.5" step="16.0" variance="0.1,0.1,0.2,0.2"/>
<input>
<port id="0">
<dim>2</dim> < !-- values: [24, 42] -->
<dim>2</dim> <!-- values: [24, 42] -->
</port>
<port id="1">
<dim>2</dim> < !-- values: [384, 672] -->
<dim>2</dim> <!-- values: [384, 672] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ PriorBox
.. meta::
:description: Learn about PriorBox-8 - an object detection operation,
:description: Learn about PriorBox-8 - an object detection operation,
which can be performed on two required input tensors.
**Versioned name**: *PriorBox-8*
@ -21,41 +21,41 @@ PriorBox
1. First, it calculates *center_x* and *center_y* of a prior box:
.. math::
W \equiv Width \quad Of \quad Image \\ H \equiv Height \quad Of \quad Image
* If step equals 0:
.. math::
center_x=(w+0.5) \\ center_y=(h+0.5)
* else:
.. math::
center_x=(w+offset)*step \\ center_y=(h+offset)*step \\ w \subset \left( 0, W \right ) \\ h \subset \left( 0, H \right )
2. Then, it calculates coordinates of prior boxes for each :math:`s \subset \left( 0, min\_sizes \right )` :
.. math::
xmin = \frac{\frac{center_x - s}{2}}{W}
.. math::
ymin = \frac{\frac{center_y - s}{2}}{H}
.. math::
xmax = \frac{\frac{center_x + s}{2}}{W}
.. math::
ymin = \frac{\frac{center_y + s}{2}}{H}
3. If *clip* attribute is set to true, each output value is clipped between :math:`\left< 0, 1 \right>`.
@ -82,7 +82,7 @@ PriorBox
* **Description**: *flip* is a flag that denotes that each *aspect_ratio* is duplicated and flipped. For example, *flip* equals 1 and *aspect_ratio* equals ``[4.0,2.0]``, meaning that the aspect_ratio is equal to ``[4.0,2.0,0.25,0.5]``.
* **Range of values**:
* false or 0 - each *aspect_ratio* is flipped
* true or 1 - each *aspect_ratio* is not flipped
* **Type**: ``boolean``
@ -193,10 +193,10 @@ PriorBox
<data aspect_ratio="2.0" clip="false" density="" fixed_ratio="" fixed_size="" flip="true" max_size="38.46" min_size="16.0" offset="0.5" step="16.0" variance="0.1,0.1,0.2,0.2"/>
<input>
<port id="0">
<dim>2</dim> < !-- values: [24, 42] -->
<dim>2</dim> <!-- values: [24, 42] -->
</port>
<port id="1">
<dim>2</dim> < !-- values: [384, 672] -->
<dim>2</dim> <!-- values: [384, 672] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ RegionYolo
.. meta::
:description: Learn about RegionYolo-1 - an object detection operation,
:description: Learn about RegionYolo-1 - an object detection operation,
which can be performed on a 4D input tensor.
**Versioned name**: *RegionYolo-1*
@ -65,7 +65,7 @@ RegionYolo
* **Description**: *do_softmax* is a flag that specifies the inference method and affects how the number of regions is determined. It also affects output shape. If it is 0, then output shape is 4D, and 2D otherwise.
* **Range of values**:
* *false* - do not perform softmax
* *true* - perform softmax
* **Type**: ``boolean``
@ -100,7 +100,7 @@ RegionYolo
.. code-block:: xml
:force:
< !-- YOLO V3 example -->
<!-- YOLO V3 example -->
<layer type="RegionYolo" ... >
<data anchors="10,14,23,27,37,58,81,82,135,169,344,319" axis="1" classes="80" coords="4" do_softmax="0" end_axis="3" mask="0,1,2" num="6"/>
<input>
@ -120,8 +120,8 @@ RegionYolo
</port>
</output>
</layer>
< !-- YOLO V2 Example -->
<!-- YOLO V2 Example -->
<layer type="RegionYolo" ... >
<data anchors="1.08,1.19,3.42,4.41,6.63,11.38,9.42,5.11,16.62,10.52" axis="1" classes="20" coords="4" do_softmax="1" end_axis="3" num="5"/>
<input>

View File

@ -5,7 +5,7 @@ Eye
.. meta::
:description: Learn about Eye-9 - a generation operation, which can be
:description: Learn about Eye-9 - a generation operation, which can be
performed on three required and one optional input tensors.
**Versioned name**: *Eye-9*
@ -23,13 +23,13 @@ Example 1. *Eye* output with ``output_type`` = ``i32``:
.. code-block:: xml
:force:
num_rows = 3
num_columns = 4
diagonal_index = 2
output = [[0 0 1 0]
[0 0 0 1]
[0 0 0 0]]
@ -38,13 +38,13 @@ Example 2. *Eye* output with ``output_type`` = ``i32``:
.. code-block:: xml
:force:
num_rows = 3
num_columns = 4
diagonal_index = -1
output = [[0 0 0 0]
[1 0 0 0]
[0 1 0 0]]
@ -53,13 +53,13 @@ Example 3. *Eye* output with ``output_type`` = ``f16``:
.. code-block:: xml
:force:
num_rows = 2
diagonal_index = 5
batch_shape = [1, 2]
output = [[[[0. 0.]
[0. 0.]]
[[0. 0.]
@ -97,13 +97,13 @@ Example 3. *Eye* output with ``output_type`` = ``f16``:
.. code-block:: xml
:force:
<layer ... name="Eye" type="Eye">
<data output_type="i8"/>
<input>
<port id="0" precision="I32"/> < !-- num rows: 5 -->
<port id="1" precision="I32"/> < !-- num columns: 5 -->
<port id="2" precision="I32"/> < !-- diagonal index -->
<port id="0" precision="I32"/> <!-- num rows: 5 -->
<port id="1" precision="I32"/> <!-- num columns: 5 -->
<port id="2" precision="I32"/> <!-- diagonal index -->
</input>
<output>
<port id="3" precision="I8" names="Eye:0">
@ -117,14 +117,14 @@ Example 3. *Eye* output with ``output_type`` = ``f16``:
.. code-block:: xml
:force:
<layer ... name="Eye" type="Eye">
<data output_type="f32"/>
<input>
<port id="0" precision="I32"/> < !-- num rows -->
<port id="1" precision="I32"/> < !-- num columns -->
<port id="2" precision="I32"/> < !-- diagonal index -->
<port id="3" precision="I32"/> < !-- batch_shape : [2, 3] -->
<port id="0" precision="I32"/> <!-- num rows -->
<port id="1" precision="I32"/> <!-- num columns -->
<port id="2" precision="I32"/> <!-- diagonal index -->
<port id="3" precision="I32"/> <!-- batch_shape : [2, 3] -->
</input>
<output>
<port id="3" precision="F32" names="Eye:0">

View File

@ -91,10 +91,10 @@ Example 3 - 2D tensor, without replacement
* **Description**: controls whether to sample with replacement (classes can be sampled multiple times).
* **Range of values**: `true`, `false`
* ``true`` - class indices can be sampled multiple times.
* ``false`` - class indices will not repeat in the output and the size of ``probs``' ``class_size`` dimension is required to be larger or equal to *num_samples* value. Might affect performance.
* **Type**: `bool`
* **Required**: *Yes*
@ -149,16 +149,16 @@ Example 3 - 2D tensor, without replacement
<layer ... name="Multinomial" type="Multinomial">
<data convert_type="f32", with_replacement="true", log_probs="false", global_seed="234", op_seed="148"/>
<input>
<port id="0" precision="FP32"> < !-- probs value: [[0.1, 0.5, 0.4]] -->
<dim>1</dim> < !-- batch size of 2 -->
<port id="0" precision="FP32"> <!-- probs value: [[0.1, 0.5, 0.4]] -->
<dim>1</dim> <!-- batch size of 2 -->
<dim>3</dim>
</port>
<port id="1" precision="I32"/> < !-- num_samples value: 5 -->
<port id="1" precision="I32"/> <!-- num_samples value: 5 -->
</input>
<output>
<port id="3" precision="I32" names="Multinomial:0">
<dim>1</dim> < !--dimension depends on input batch size -->
<dim>5</dim> < !--dimension depends on num_samples -->
<dim>1</dim> <!--dimension depends on input batch size -->
<dim>5</dim> <!--dimension depends on num_samples -->
</port>
</output>
</layer>
@ -171,16 +171,16 @@ Example 3 - 2D tensor, without replacement
<layer ... name="Multinomial" type="Multinomial">
<data convert_type="f32", with_replacement="true", log_probs="true", global_seed="234", op_seed="148"/>
<input>
<port id="0" precision="FP32"> < !-- probs value: [[-1, 1, 2], [50, 1, 21]] -->
<dim>2</dim> < !-- batch size of 2 -->
<port id="0" precision="FP32"> <!-- probs value: [[-1, 1, 2], [50, 1, 21]] -->
<dim>2</dim> <!-- batch size of 2 -->
<dim>3</dim>
</port>
<port id="1" precision="I32"/> < !-- num_samples value: 10 -->
<port id="1" precision="I32"/> <!-- num_samples value: 10 -->
</input>
<output>
<port id="3" precision="I32" names="Multinomial:0">
<dim>2</dim> < !--dimension depends on input batch size -->
<dim>10</dim> < !--dimension depends on num_samples -->
<dim>2</dim> <!--dimension depends on input batch size -->
<dim>10</dim> <!--dimension depends on num_samples -->
</port>
</output>
</layer>
@ -193,16 +193,16 @@ Example 3 - 2D tensor, without replacement
<layer ... name="Multinomial" type="Multinomial">
<data convert_type="f32", with_replacement="false", log_probs="false", global_seed="234", op_seed="148"/>
<input>
<port id="0" precision="FP32"> < !-- probs value: [[0.1, 0.5, 0.4]] -->
<dim>2</dim> < !-- batch size of 2 -->
<port id="0" precision="FP32"> <!-- probs value: [[0.1, 0.5, 0.4]] -->
<dim>2</dim> <!-- batch size of 2 -->
<dim>3</dim>
</port>
<port id="1" precision="I32"/> < !-- num_samples value: 2 -->
<port id="1" precision="I32"/> <!-- num_samples value: 2 -->
</input>
<output>
<port id="3" precision="I32" names="Multinomial:0">
<dim>2</dim> < !-- batch size of 2 -->
<dim>2</dim> < !-- 2 unique samples of classes -->
<dim>2</dim> <!-- batch size of 2 -->
<dim>2</dim> <!-- 2 unique samples of classes -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ RandomUniform
.. meta::
:description: Learn about RandomUniform-8 - a generation operation, which can be
:description: Learn about RandomUniform-8 - a generation operation, which can be
performed on three required input tensors.
**Versioned name**: *RandomUniform-8*
@ -16,10 +16,10 @@ RandomUniform
**Detailed description**:
*RandomUniform* operation generates random numbers from a uniform distribution in the range ``[minval, maxval)``.
The generation algorithm is based on underlying random integer generator that uses Philox algorithm. Philox algorithm
is a counter-based pseudo-random generator, which produces uint32 values. Single invocation of Philox algorithm returns
four result random values, depending on the given *key* and *counter* values. *Key* and *counter* are initialized
*RandomUniform* operation generates random numbers from a uniform distribution in the range ``[minval, maxval)``.
The generation algorithm is based on underlying random integer generator that uses Philox algorithm. Philox algorithm
is a counter-based pseudo-random generator, which produces uint32 values. Single invocation of Philox algorithm returns
four result random values, depending on the given *key* and *counter* values. *Key* and *counter* are initialized
with *global_seed* and *op_seed* attributes respectively.
If both seed values equal to zero, RandomUniform generates non-deterministic sequence.
@ -32,7 +32,7 @@ If both seed values equal to zero, RandomUniform generates non-deterministic seq
Link to the original paper `Parallel Random Numbers: As Easy as 1, 2, 3 <https://www.thesalmons.org/john/random123/papers/random123sc11.pdf>`__.
The result of Philox is calculated by applying a fixed number of *key* and *counter* updating so-called "rounds".
The result of Philox is calculated by applying a fixed number of *key* and *counter* updating so-called "rounds".
This implementation uses 4x32_10 version of Philox algorithm, where number of rounds = 10.
Suppose we have *n* which determines *n*-th 4 elements of random sequence.
@ -43,7 +43,7 @@ In each round *key*, *counter* and *n* are splitted to pairs of uint32 values:
R = cast\_to\_uint32(value)\\
L = cast\_to\_uint32(value >> 32),
where *cast\_to\_uint32* - static cast to uint32, *value* - uint64 input value, *L*, *R* - uint32
where *cast\_to\_uint32* - static cast to uint32, *value* - uint64 input value, *L*, *R* - uint32
result values, >> - bitwise right shift.
Then *n* and *counter* are updated with the following formula:
@ -68,7 +68,7 @@ Values :math:`L'_{n}, R'_{n}, L'_{counter}, R'_{counter}` are resulting four ran
Float values between [0..1) are obtained from 32-bit integers by the following rules.
Float16 is formatted as follows: *sign* (1 bit) *exponent* (5 bits) *mantissa* (10 bits). The value is interpreted
Float16 is formatted as follows: *sign* (1 bit) *exponent* (5 bits) *mantissa* (10 bits). The value is interpreted
using following formula:
.. math::
@ -99,7 +99,7 @@ where x is uint32 generated random value.
Float32 is formatted as follows: *sign* (1 bit) *exponent* (8 bits) *mantissa* (23 bits). The value is interpreted using following formula:
.. math::
(-1)^{sign} * 1, mantissa * 2 ^{exponent - 127}
@ -117,7 +117,7 @@ So the resulting float value is:
.. code-block:: xml
:force:
val = ((exponent << 23) | x & 0x7fffffu) - 1.0,
where x is uint32 generated random value.
@ -125,7 +125,7 @@ where x is uint32 generated random value.
Double is formatted as follows: *sign* (1 bit) *exponent* (11 bits) *mantissa* (52 bits). The value is interpreted using following formula:
.. math::
(-1)^{sign} * 1, mantissa * 2 ^{exponent - 1023}
@ -133,7 +133,7 @@ so to obtain double values *sign*, *exponent* and *mantissa* are set as follows:
.. code-block:: xml
:force:
sign = 0
exponent = 1023 - representation of a zero exponent.
mantissa = 52 right bits from two concatinated uint32 values from random integer generator.
@ -143,7 +143,7 @@ So the resulting double is obtained as follows:
.. code-block:: xml
:force:
mantissa_h = x0 & 0xfffffu; // upper 20 bits of mantissa
mantissa_l = x1; // lower 32 bits of mantissa
mantissa = (mantissa_h << 32) | mantissa_l;
@ -156,7 +156,7 @@ To obtain a value in a specified range each value is processed with the followin
For float values:
.. math::
result = x * (maxval - minval) + minval,
where *x* is random float or double value between [0..1).
@ -174,7 +174,7 @@ Example 1. *RandomUniform* output with ``global_seed`` = 150, ``op_seed`` = 10,
.. code-block:: xml
:force:
input_shape = [ 3, 3 ]
output = [[0.7011236 0.30539632 0.93931055]
[0.9456035 0.11694777 0.50770056]
@ -185,7 +185,7 @@ Example 2. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100,
.. code-block:: xml
:force:
input_shape = [ 2, 2 ]
minval = 2
@ -200,7 +200,7 @@ Example 3. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100,
.. code-block:: xml
:force:
input_shape = [ 2, 3 ]
minval = 50
@ -261,11 +261,11 @@ Example 3. *RandomUniform* output with ``global_seed`` = 80, ``op_seed`` = 100,
<layer ... name="RandomUniform" type="RandomUniform">
<data output_type="f32" global_seed="234" op_seed="148"/>
<input>
<port id="0" precision="I32"> < !-- shape value: [2, 3, 10] -->
<port id="0" precision="I32"> <!-- shape value: [2, 3, 10] -->
<dim>3</dim>
</port>
<port id="1" precision="FP32"/> < !-- min value -->
<port id="2" precision="FP32"/> < !-- max value -->
<port id="1" precision="FP32"/> <!-- min value -->
<port id="2" precision="FP32"/> <!-- max value -->
</input>
<output>
<port id="3" precision="FP32" names="RandomUniform:0">

View File

@ -5,7 +5,7 @@ Range
.. meta::
:description: Learn about Range-1 - a generation operation, which can be
:description: Learn about Range-1 - a generation operation, which can be
performed on three required input tensors.
**Versioned name**: *Range-1*
@ -46,7 +46,7 @@ For a positive ``step``:
for a negative ``step``:
.. math::
start>=val[i]>stop,
@ -66,16 +66,16 @@ where
<layer ... type="Range">
<input>
<port id="0"> < !-- start value: 2 -->
<port id="0"> <!-- start value: 2 -->
</port>
<port id="1"> < !-- stop value: 23 -->
<port id="1"> <!-- stop value: 23 -->
</port>
<port id="2"> < !-- step value: 3 -->
<port id="2"> <!-- step value: 3 -->
</port>
</input>
<output>
<port id="3">
<dim>7</dim> < !-- [ 2, 5, 8, 11, 14, 17, 20] -->
<dim>7</dim> <!-- [ 2, 5, 8, 11, 14, 17, 20] -->
</port>
</output>
</layer>
@ -88,16 +88,16 @@ where
<layer ... type="Range">
<input>
<port id="0"> < !-- start value: 23 -->
<port id="0"> <!-- start value: 23 -->
</port>
<port id="1"> < !-- stop value: 2 -->
<port id="1"> <!-- stop value: 2 -->
</port>
<port id="2"> < !-- step value: -3 -->
<port id="2"> <!-- step value: -3 -->
</port>
</input>
<output>
<port id="3">
<dim>7</dim> < !-- [23, 20, 17, 14, 11, 8, 5] -->
<dim>7</dim> <!-- [23, 20, 17, 14, 11, 8, 5] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ Range
.. meta::
:description: Learn about Range-4 - a generation operation, which can be
:description: Learn about Range-4 - a generation operation, which can be
performed on three required input tensors.
**Versioned name**: *Range-4*
@ -81,16 +81,16 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf
<layer ... type="Range">
<data output_type="i32">
<input>
<port id="0"> < !-- start value: 2 -->
<port id="0"> <!-- start value: 2 -->
</port>
<port id="1"> < !-- stop value: 23 -->
<port id="1"> <!-- stop value: 23 -->
</port>
<port id="2"> < !-- step value: 3 -->
<port id="2"> <!-- step value: 3 -->
</port>
</input>
<output>
<port id="3">
<dim>7</dim> < !-- [ 2, 5, 8, 11, 14, 17, 20] -->
<dim>7</dim> <!-- [ 2, 5, 8, 11, 14, 17, 20] -->
</port>
</output>
</layer>
@ -104,16 +104,16 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf
<layer ... type="Range">
<data output_type="i32">
<input>
<port id="0"> < !-- start value: 23 -->
<port id="0"> <!-- start value: 23 -->
</port>
<port id="1"> < !-- stop value: 2 -->
<port id="1"> <!-- stop value: 2 -->
</port>
<port id="2"> < !-- step value: -3 -->
<port id="2"> <!-- step value: -3 -->
</port>
</input>
<output>
<port id="3">
<dim>7</dim> < !-- [23, 20, 17, 14, 11, 8, 5] -->
<dim>7</dim> <!-- [23, 20, 17, 14, 11, 8, 5] -->
</port>
</output>
</layer>
@ -127,16 +127,16 @@ This is aligned with PyTorch's operation ``torch.arange``, to align with tensorf
<layer ... type="Range">
<data output_type="f32">
<input>
<port id="0"> < !-- start value: 1 -->
<port id="0"> <!-- start value: 1 -->
</port>
<port id="1"> < !-- stop value: 2.5 -->
<port id="1"> <!-- stop value: 2.5 -->
</port>
<port id="2"> < !-- step value: 0.5 -->
<port id="2"> <!-- step value: 0.5 -->
</port>
</input>
<output>
<port id="3">
<dim>3</dim> < !-- [ 1.0, 1.5, 2.0] -->
<dim>3</dim> <!-- [ 1.0, 1.5, 2.0] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ I420toBGR
.. meta::
:description: Learn about I420toBGR-8 - an image processing operation, which
:description: Learn about I420toBGR-8 - an image processing operation, which
can be performed to convert image from I420 to BGR format.
**Versioned name**: *I420toBGR-8*
@ -70,19 +70,19 @@ Same as specified for :doc:`I420toRGB <openvino_docs_ops_image_I420toRGB_8>` ope
<layer ... type="I420toBGR">
<input>
<port id="0">  < !-- Y plane -->
<port id="0">  <!-- Y plane -->
<dim>1</dim>
<dim>480</dim>
<dim>640</dim>
<dim>1</dim>
</port>
<port id="1">  < !-- U plane -->
<port id="1">  <!-- U plane -->
<dim>1</dim>
<dim>240</dim>
<dim>320</dim>
<dim>1</dim>
</port>
<port id="2">  < !-- V plane -->
<port id="2">  <!-- V plane -->
<dim>1</dim>
<dim>240</dim>
<dim>320</dim>

View File

@ -5,7 +5,7 @@ I420toRGB
.. meta::
:description: Learn about I420toRGB-8 - an image processing operation, which
:description: Learn about I420toRGB-8 - an image processing operation, which
can be performed to convert image from I420 to RGB format.
**Versioned name**: *I420toRGB-8*
@ -113,19 +113,19 @@ Input I420 image tensor shall have ``NHWC (also known as NYXC)`` layout and can
<layer ... type="I420toRGB">
<input>
<port id="0">  < !-- Y plane -->
<port id="0">  <!-- Y plane -->
<dim>1</dim>
<dim>480</dim>
<dim>640</dim>
<dim>1</dim>
</port>
<port id="1">  < !-- U plane -->
<port id="1">  <!-- U plane -->
<dim>1</dim>
<dim>240</dim>
<dim>320</dim>
<dim>1</dim>
</port>
<port id="2">  < !-- V plane -->
<port id="2">  <!-- V plane -->
<dim>1</dim>
<dim>240</dim>
<dim>320</dim>

View File

@ -5,7 +5,7 @@ Interpolate
.. meta::
:description: Learn about I420toRGB-8 - an image processing operation, which
:description: Learn about I420toRGB-8 - an image processing operation, which
can be performed on two required tensors.
**Versioned name**: *Interpolate-1*
@ -91,7 +91,7 @@ This is a scalar that specifies padding for each spatial dimension.
<dim>80</dim>
</port>
<port id="1">
<dim>2</dim>  < !--The values in this input are [50, 60] -->
<dim>2</dim>  <!--The values in this input are [50, 60] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Interpolate
.. meta::
:description: Learn about Interpolate-11 - an image processing operation, which
:description: Learn about Interpolate-11 - an image processing operation, which
can be performed on two required and one optional tensor.
**Versioned name**: *Interpolate-11*
@ -129,13 +129,13 @@ Interpolate
<dim>80</dim>
</port>
<port id="1">
<dim>2</dim> < !--The values in this input are [24, 160] -->
<dim>2</dim> <!--The values in this input are [24, 160] -->
</port>
<port id="2">
<dim>2</dim> < !--The values in this input are [0.5, 2.0] -->
<dim>2</dim> <!--The values in this input are [0.5, 2.0] -->
</port>
<port id="3">
<dim>2</dim> < !--The values in this input are [2, 3] (axes). -->
<dim>2</dim> <!--The values in this input are [2, 3] (axes). -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Interpolate
.. meta::
:description: Learn about Interpolate-4 - an image processing operation, which
:description: Learn about Interpolate-4 - an image processing operation, which
can be performed on three required and one optional tensor.
**Versioned name**: *Interpolate-4*
@ -128,7 +128,7 @@ Calculations are performed according to the following rules.
import math
import numpy as np
from enum import Enum, unique
class GetNearestPixel:
def __init__(self, mode: str):
self.func = {
@ -138,37 +138,37 @@ Calculations are performed according to the following rules.
'ceil': GetNearestPixel.ceil_func,
'simple': GetNearestPixel.simple_func
}[mode]
def __call__(self, x_original, is_downsample):
return self.func(x_original, is_downsample)
@staticmethod
def prefer_floor_func(x_original, is_downsample):
if x_original == int(x_original) + 0.5:
return int(math.floor(x_original))
else:
return int(round(x_original))
@staticmethod
def prefer_ceil_func(x_original, is_downsample):
return int(round(x_original))
@staticmethod
def floor_func(x_original, is_downsample):
return int(math.floor(x_original))
@staticmethod
def ceil_func(x_original, is_downsample):
return int(math.ceil(x_original))
@staticmethod
def simple_func(x_original, is_downsample):
if is_downsample:
return int(math.ceil(x_original))
else:
return int(x_original)
class GetOriginalCoordinate:
def __init__(self, mode: str):
self.func = {
@ -178,31 +178,31 @@ Calculations are performed according to the following rules.
'tf_half_pixel_for_nn': GetOriginalCoordinate.tf_half_pixel_for_nn_func,
'align_corners': GetOriginalCoordinate.align_corners_func
}[mode]
def __call__(self, x_resized, x_scale, length_resized, length_original):
return self.func(x_resized, x_scale, length_resized, length_original)
@staticmethod
def half_pixel_func(x_resized, x_scale, length_resized, length_original):
return ((x_resized + 0.5) / x_scale) - 0.5
@staticmethod
def pytorch_half_pixel_func(x_resized, x_scale, length_resized, length_original):
return (x_resized + 0.5) / x_scale - 0.5 if length_resized > 1 else 0.0
@staticmethod
def asymmetric_func(x_resized, x_scale, length_resized, length_original):
return x_resized / x_scale
@staticmethod
def tf_half_pixel_for_nn_func(x_resized, x_scale, length_resized, length_original):
return (x_resized + 0.5) / x_scale
@staticmethod
def align_corners_func(x_resized, x_scale, length_resized, length_original):
return 0 if length_resized == 1 else x_resized * (length_original - 1) / (length_resized - 1)
def get_cubic_coeff(s, a):
abs_s = abs(s)
coeff = np.zeros(4)
@ -211,18 +211,18 @@ Calculations are performed according to the following rules.
coeff[2] = (((-a -2.0) * abs_s+ (2.0 * a + 3.0)) * abs_s - a) * abs_s
coeff[3] = - a * abs_s * abs_s * (abs_s - 1.0)
return coeff
def triangle_coeffs(dz):
return np.maximum(0.0, 1.0 - np.abs(dz))
@unique
class ShapeCalculationMode(Enum):
SIZES = 0
SCALES = 1
class InterpolateCalculation:
def __init__(self, attrs: dict):
self.mode = attrs['mode']
@ -233,38 +233,38 @@ Calculations are performed according to the following rules.
'linear_onnx': self.onnx_linear_interpolation
}[self.mode]
self.attrs = attrs
self.pads_begin = attrs.get('pads_begin', [0])
self.pads_end = attrs.get('pads_end', [0])
self.coordinate_transformation_mode = attrs.get('coordinate_transformation_mode', 'half_pixel')
self.nearest_mode = attrs.get('nearest_mode', 'round_prefer_floor')
self.cube_coeff = attrs.get('cube_coeff', -0.75)
self.antialias = attrs.get('antialias', False)
self.shape_calculation_mode = {
'sizes': ShapeCalculationMode.SIZES,
'scales': ShapeCalculationMode.SCALES
}[attrs['shape_calculation_mode']]
self.get_original_coordinate = self.get_coordinate_transformation_mode()
self.get_nearest_pixel = GetNearestPixel(self.nearest_mode)
def get_coordinate_transformation_mode(self):
return GetOriginalCoordinate(self.coordinate_transformation_mode)
def shape_infer(self, input_data, sizes, scales):
result = input_data.shape + self.pads_begin + self.pads_end
if self.shape_calculation_mode == ShapeCalculationMode.SIZES:
for i, axis in enumerate(self.axes):
result[axis] = sizes[i]
else:
for i, axis in enumerate(self.axes):
result[axis] = math.floor(scales[i] * result[axis])
return result
@staticmethod
def correct_pad(pad, rank):
pad_len = len(pad)
@ -274,17 +274,17 @@ Calculations are performed according to the following rules.
return np.array(pad[: rank - 1]).astype(np.int64)
else:
return np.array(pad, dtype=np.int64)
def __call__(self, input_data, sizes, scales, axes):
rank = input_data.ndim
self.pads_begin = InterpolateCalculation.correct_pad(self.pads_begin, rank)
self.pads_end = InterpolateCalculation.correct_pad(self.pads_end, rank)
self.pads = list(zip(self.pads_begin, self.pads_end))
self.axes = np.array(axes).astype(np.int64)
self.output_shape = self.shape_infer(input_data, sizes, scales)
padded_data = np.pad(input_data, self.pads, 'constant')
if self.shape_calculation_mode == ShapeCalculationMode.SIZES:
num_of_axes = len(self.axes)
self.scales = np.zeros(num_of_axes)
@ -292,18 +292,18 @@ Calculations are performed according to the following rules.
self.scales[i] = self.output_shape[axis] / padded_data.shape[axis]
else:
self.scales = scales
if self.mode == 'nearest':
self.all_scales = np.ones(rank).astype(np.float)
for i, axis in enumerate(self.axes):
self.all_scales[axis] = self.scales[i]
self.input_shape = padded_data.shape
return self.func(padded_data)
def clip_coord(self, coord, axis):
return max(0, min(coord, self.input_shape[axis] - 1))
def cubic_interpolation(self, input_data):
rank = len(self.input_shape)
result = np.zeros(self.output_shape)
@ -328,28 +328,28 @@ Calculations are performed according to the following rules.
summa += coeffs_prod * input_data[tuple(coords_for_sum)]
result[coordinates] = summa
return result
def linear_interpolation(self, input_data):
result = np.zeros(self.output_shape)
num_of_axes = len(self.axes)
is_downsample = False
for scale in self.scales:
is_downsample = is_downsample or (scale < 1)
antialias = is_downsample and self.antialias
a = np.zeros(num_of_axes)
for i, _ in enumerate(self.axes):
a[i] = self.scales[i] if antialias else 1.0
prod_of_a = np.prod(a)
r = np.zeros(num_of_axes).astype(np.int64)
for i, _ in enumerate(self.axes):
r[i] = 2 if self.scales[i] > 1.0 else int(math.ceil(2.0/a[i]))
indices = [tuple(np.array(ind).astype(np.int64) - r) for ind in np.ndindex(tuple(2 * r + 1))]
for coordinates in np.ndindex(tuple(self.output_shape)):
icoords = np.array(coordinates).astype(np.float64)
icoords_r = np.array(coordinates).astype(np.float64)
@ -357,51 +357,51 @@ Calculations are performed according to the following rules.
in_coord = self.get_original_coordinate(coordinates[axis], self.scales[i], self.output_shape[axis], self.input_shape[axis])
icoords[axis] = in_coord
icoords_r[axis] = round(in_coord)
summa = 0.0
wsum = 0.0
for index in indices:
inner_coords = np.array(coordinates)
for i, axis in enumerate(self.axes):
inner_coords[axis] = index[i] + icoords_r[axis]
conditions = [inner_coords[axis] >= 0 and inner_coords[axis] < self.input_shape[axis] for axis in self.axes]
if not all(conditions):
continue
dz = np.zeros(num_of_axes)
for i, axis in enumerate(self.axes):
dz[i] = icoords[axis] - inner_coords[axis]
w = prod_of_a * np.prod(triangle_coeffs(a * dz))
wsum += w
summa += w * input_data[tuple(inner_coords)]
if wsum == 0:
result[coordinates] = 0.0
else:
result[coordinates] = summa / wsum
return result
def onnx_linear_interpolation5D(self, input_data):
rank = len(self.input_shape)
assert rank in [3, 5], "mode 'linear_onnx' supports only 3D or 5D tensors"
assert set(self.axes) == {2, 3, 4} or set(self.axes) == {0, 1, 2}, \
"mode 'linear_onnx' supports only case when axes = {2, 3, 4} or axes = {0, 1, 2}"
result = np.zeros(self.output_shape)
if rank == 3:
reshaped_data = np.reshape(input_data, (1, 1, self.input_shape[0], self.input_shape[1], self.input_shape[2]))
result = np.reshape(result, (1, 1, self.output_shape[0], self.output_shape[1], self.output_shape[2]))
else:
reshaped_data = input_data
input_shape = np.array(reshaped_data.shape).astype(np.int64)
output_shape = np.array(result.shape).astype(np.int64)
batch_size = input_shape[0];
num_channels = input_shape[1];
input_depth = input_shape[2];
@ -410,31 +410,31 @@ Calculations are performed according to the following rules.
output_depth = output_shape[2];
output_height = output_shape[3];
output_width = output_shape[4];
depth_scale = self.scales[0];
height_scale = self.scales[1];
width_scale = self.scales[2];
z_original = np.zeros(output_depth).astype(np.float)
y_original = np.zeros(output_height).astype(np.float)
x_original = np.zeros(output_width).astype(np.float)
in_z1 = np.zeros(output_depth).astype(np.int64)
in_z2 = np.zeros(output_depth).astype(np.int64)
in_y1 = np.zeros(output_height).astype(np.int64)
in_y2 = np.zeros(output_height).astype(np.int64)
in_x1 = np.zeros(output_width).astype(np.int64)
in_x2 = np.zeros(output_width).astype(np.int64)
dz1 = np.zeros(output_depth).astype(np.float)
dz2 = np.zeros(output_depth).astype(np.float)
dy1 = np.zeros(output_height).astype(np.float)
dy2 = np.zeros(output_height).astype(np.float)
dx1 = np.zeros(output_width).astype(np.float)
dx2 = np.zeros(output_width).astype(np.float)
for z in range(0, output_depth):
in_z = self.get_original_coordinate(z, depth_scale, output_depth, input_depth)
z_original[z] = in_z
@ -443,11 +443,11 @@ Calculations are performed according to the following rules.
in_z2[z] = min(in_z1[z] + 1, input_depth - 1)
dz1[z] = abs(in_z - in_z1[z])
dz2[z] = abs(in_z - in_z2[z])
if in_z1[z] == in_z2[z]:
dz1[z] = 0.5
dz2[z] = 0.5
for y in range(0, output_height):
in_y = self.get_original_coordinate(y, height_scale, output_height, input_height)
y_original[y] = in_y
@ -456,19 +456,19 @@ Calculations are performed according to the following rules.
in_y2[y] = min(in_y1[y] + 1, input_height - 1)
dy1[y] = abs(in_y - in_y1[y])
dy2[y] = abs(in_y - in_y2[y])
if in_y1[y] == in_y2[y]:
dy1[y] = 0.5
dy2[y] = 0.5
for x in range(0, output_width):
in_x = self.get_original_coordinate(x, width_scale, output_width, input_width);
x_original[x] = in_x
in_x = max(0.0, min(in_x, input_width - 1));
in_x1[x] = min(in_x, input_width - 1);
in_x2[x] = min(in_x1[x] + 1, input_width - 1);
dx1[x] = abs(in_x - in_x1[x]);
dx2[x] = abs(in_x - in_x2[x]);
if in_x1[x] == in_x2[x]:
@ -487,33 +487,33 @@ Calculations are performed according to the following rules.
x212 = reshaped_data[n, c, in_z2[z], in_y1[y], in_x2[x]]
x122 = reshaped_data[n, c, in_z2[z], in_y2[y], in_x1[x]]
x222 = reshaped_data[n, c, in_z2[z], in_y2[y], in_x2[x]]
temp = dx2[x] * dy2[y] * dz2[z] * x111 + dx1[x] * dy2[y] * dz2[z] * x211
temp += dx2[x] * dy1[y] * dz2[z] * x121 + dx1[x] * dy1[y] * dz2[z] * x221
temp += dx2[x] * dy2[y] * dz1[z] * x112 + dx1[x] * dy2[y] * dz1[z] * x212
temp += dx2[x] * dy1[y] * dz1[z] * x122 + dx1[x] * dy1[y] * dz1[z] * x222
result[n, c, z, y, x] = temp
return np.reshape(result, self.output_shape)
def onnx_linear_interpolation4D(self, input_data):
rank = len(self.input_shape)
assert rank in [2, 4], "mode 'linear_onnx' supports only 2D or 4D tensors"
assert set(self.axes) == {2, 3} or set(self.axes) == {0, 1}, \
"mode 'linear_onnx' supports only case when axes = {2, 3} or axes = {0, 1}"
result = np.zeros(self.output_shape)
if rank == 2:
reshaped_data = np.reshape(input_data, (1, 1, self.input_shape[0], self.input_shape[1]))
result = np.reshape(result, (1, 1, self.output_shape[0], self.output_shape[1]))
else:
reshaped_data = input_data
input_shape = np.array(reshaped_data.shape).astype(np.int64)
output_shape = np.array(result.shape).astype(np.int64)
output_height = output_shape[2]
output_width = output_shape[3]
input_height = input_shape[2]
@ -522,21 +522,21 @@ Calculations are performed according to the following rules.
width_scale = self.scales[1]
batch_size = input_shape[0]
num_channels = input_shape[1]
y_original = np.zeros(output_height).astype(np.float)
x_original = np.zeros(output_width).astype(np.float)
in_y1 = np.zeros(output_height).astype(np.int64)
in_y2 = np.zeros(output_height).astype(np.int64)
in_x1 = np.zeros(output_width).astype(np.int64)
in_x2 = np.zeros(output_width).astype(np.int64)
dy1 = np.zeros(output_height).astype(np.float)
dy2 = np.zeros(output_height).astype(np.float)
dx1 = np.zeros(output_width).astype(np.float)
dx2 = np.zeros(output_width).astype(np.float)
for y in range(0, output_height):
in_y = self.get_original_coordinate(y, height_scale, output_height, input_height)
y_original[y] = in_y
@ -545,25 +545,25 @@ Calculations are performed according to the following rules.
in_y2[y] = min(in_y1[y] + 1, input_height - 1)
dy1[y] = abs(in_y - in_y1[y])
dy2[y] = abs(in_y - in_y2[y])
if in_y1[y] == in_y2[y]:
dy1[y] = 0.5
dy2[y] = 0.5
for x in range(0, output_width):
in_x = self.get_original_coordinate(x, width_scale, output_width, input_width);
x_original[x] = in_x
in_x = max(0.0, min(in_x, input_width - 1));
in_x1[x] = min(in_x, input_width - 1);
in_x2[x] = min(in_x1[x] + 1, input_width - 1);
dx1[x] = abs(in_x - in_x1[x]);
dx2[x] = abs(in_x - in_x2[x]);
if in_x1[x] == in_x2[x]:
dx1[x] = 0.5
dx2[x] = 0.5
for n in range(0, batch_size):
for c in range(0, num_channels):
for y in range(0, output_height):
@ -574,21 +574,21 @@ Calculations are performed according to the following rules.
x22 = reshaped_data[n, c, in_y2[y], in_x2[x]]
temp = dx2[x] * dy2[y] * x11 + dx1[x] * dy2[y] * x21 + dx2[x] * dy1[y] * x12 + dx1[x] * dy1[y] * x22
result[n, c, y, x] = temp
return np.reshape(result, self.output_shape)
def onnx_linear_interpolation(self, input_data):
rank = len(self.input_shape)
assert rank in [2, 3, 4, 5], "mode 'linear_onnx' supports only 2D, 3D, 4D, or 5D tensors"
if rank in [2, 4]:
self.onnx_linear_interpolation4D(input_data)
else:
self.onnx_linear_interpolation5D(input_data)
def nearest_interpolation(self, input_data):
result = np.zeros(self.output_shape)
num_of_axes = len(self.axes)
for coordinates in np.ndindex(tuple(self.output_shape)):
input_coords = np.array(coordinates, dtype=np.int64)
@ -597,7 +597,7 @@ Calculations are performed according to the following rules.
nearest_pixel = self.get_nearest_pixel(in_coord, scale < 1)
input_coords[axis] = max(0, min(nearest_pixel, self.input_shape[axis] - 1))
result[coordinates] = input_data[tuple(input_coords)]
return result
@ -617,13 +617,13 @@ Calculations are performed according to the following rules.
<dim>80</dim>
</port>
<port id="1">
<dim>2</dim>  < !--The values in this input are [24, 160] -->
<dim>2</dim>  <!--The values in this input are [24, 160] -->
</port>
<port id="2">
<dim>2</dim>  < !--The values in this input are [0.5, 2.0] -->
<dim>2</dim>  <!--The values in this input are [0.5, 2.0] -->
</port>
<port id="3">
<dim>2</dim>  < !--The values in this input are [2, 3] (axes). -->
<dim>2</dim>  <!--The values in this input are [2, 3] (axes). -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ NV12toBGR
.. meta::
:description: Learn about NV12toBGR-8 - an image processing operation, which
:description: Learn about NV12toBGR-8 - an image processing operation, which
can be performed to convert an image from NV12 to BGR format.
**Versioned name**: *NV12toBGR-8*
@ -70,13 +70,13 @@ Same as specified for :doc:`NV12toRGB <openvino_docs_ops_image_NV12toRGB_8>` ope
<layer ... type="NV12toBGR">
<input>
<port id="0"> < !-- Y plane -->
<port id="0"> <!-- Y plane -->
<dim>1</dim>
<dim>480</dim>
<dim>640</dim>
<dim>1</dim>
</port>
<port id="1"> < !-- UV plane -->
<port id="1"> <!-- UV plane -->
<dim>1</dim>
<dim>240</dim>
<dim>320</dim>

View File

@ -5,7 +5,7 @@ NV12toRGB
.. meta::
:description: Learn about NV12toRGB-8 - an image processing operation, which
:description: Learn about NV12toRGB-8 - an image processing operation, which
can be performed to convert an image from NV12 to RGB format.
**Versioned name**: *NV12toRGB-8*
@ -102,13 +102,13 @@ Input NV12 image tensor shall have ``NHWC (also known as NYXC)`` layout and can
<layer ... type="NV12toRGB">
<input>
<port id="0"> < !-- Y plane -->
<port id="0"> <!-- Y plane -->
<dim>1</dim>
<dim>480</dim>
<dim>640</dim>
<dim>1</dim>
</port>
<port id="1"> < !-- UV plane -->
<port id="1"> <!-- UV plane -->
<dim>1</dim>
<dim>240</dim>
<dim>320</dim>

View File

@ -5,7 +5,7 @@ BatchToSpace
.. meta::
:description: Learn about BatchToSpace-2 - a data movement operation,
:description: Learn about BatchToSpace-2 - a data movement operation,
which can be performed on four required input tensors.
**Versioned name**: *BatchToSpace-2*
@ -21,25 +21,25 @@ BatchToSpace
1. Reshape ``data`` input to produce a tensor of shape :math:`[B_1, \dots, B_{N - 1}, \frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1, D_2, \dots, D_{N - 1}]`
.. math::
x^{\prime} = reshape(data, [B_1, \dots, B_{N - 1}, \frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1, D_2, \dots, D_{N - 1}])
2. Permute dimensions of :math:`x^{\prime}` to produce a tensor of shape :math:`[\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1, B_1, D_2, B_2, \dots, D_{N-1}, B_{N - 1}]`
.. math::
x^{\prime\prime} = transpose(x', [N, N + 1, 0, N + 2, 1, \dots, N + N - 1, N - 1])
3. Reshape :math:`x^{\prime\prime}` to produce a tensor of shape :math:`[\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1 \times B_1, D_2 \times B_2, \dots, D_{N - 1} \times B_{N - 1}]`
.. math::
x^{\prime\prime\prime} = reshape(x^{\prime\prime}, [\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, D_1 \times B_1, D_2 \times B_2, \dots, D_{N - 1} \times B_{N - 1}])
4. Crop the start and end of spatial dimensions of :math:`x^{\prime\prime\prime}` according to ``crops_begin`` and ``crops_end`` inputs to produce the output :math:`y` of shape:
.. math::
\left[\frac{batch}{\left(B_1 \times \dots \times B_{N - 1}\right)}, crop(D_1 \times B_1, CB_1, CE_1), crop(D_2 \times B_2, CB_2, CE_2), \dots , crop(D_{N - 1} \times B_{N - 1}, CB_{N - 1}, CE_{N - 1})\right]
Where
@ -80,27 +80,27 @@ Example: 2D input tensor ``data``
.. code-block:: xml
:force:
<layer type="BatchToSpace" ...>
<input>
<port id="0"> < !-- data -->
<dim>10</dim> < !-- batch -->
<dim>2</dim> < !-- spatial dimension 1 -->
<port id="0"> <!-- data -->
<dim>10</dim> <!-- batch -->
<dim>2</dim> <!-- spatial dimension 1 -->
</port>
<port id="1"> < !-- block_shape value: [1, 5] -->
<port id="1"> <!-- block_shape value: [1, 5] -->
<dim>2</dim>
</port>
<port id="2"> < !-- crops_begin value: [0, 2] -->
<port id="2"> <!-- crops_begin value: [0, 2] -->
<dim>2</dim>
</port>
<port id="3"> < !-- crops_end value: [0, 0] -->
<port id="3"> <!-- crops_end value: [0, 0] -->
<dim>2</dim>
</port>
</input>
<output>
<port id="3">
<dim>2</dim> < !-- data.shape[0] / (block_shape.shape[0] * block_shape.shape[1]) -->
<dim>8</dim> < !-- data.shape[1] * block_shape.shape[1] - crops_begin[1] - crops_end[1]-->
<dim>2</dim> <!-- data.shape[0] / (block_shape.shape[0] * block_shape.shape[1]) -->
<dim>8</dim> <!-- data.shape[1] * block_shape.shape[1] - crops_begin[1] - crops_end[1]-->
</port>
</output>
</layer>
@ -109,33 +109,33 @@ Example: 5D input tensor ``data``
.. code-block:: xml
:force:
<layer type="BatchToSpace" ...>
<input>
<port id="0"> < !-- data -->
<dim>48</dim> < !-- batch -->
<dim>3</dim> < !-- spatial dimension 1 -->
<dim>3</dim> < !-- spatial dimension 2 -->
<dim>1</dim> < !-- spatial dimension 3 -->
<dim>3</dim> < !-- spatial dimension 4 -->
<port id="0"> <!-- data -->
<dim>48</dim> <!-- batch -->
<dim>3</dim> <!-- spatial dimension 1 -->
<dim>3</dim> <!-- spatial dimension 2 -->
<dim>1</dim> <!-- spatial dimension 3 -->
<dim>3</dim> <!-- spatial dimension 4 -->
</port>
<port id="1"> < !-- block_shape value: [1, 2, 4, 3, 1] -->
<port id="1"> <!-- block_shape value: [1, 2, 4, 3, 1] -->
<dim>5</dim>
</port>
<port id="2"> < !-- crops_begin value: [0, 0, 1, 0, 0] -->
<port id="2"> <!-- crops_begin value: [0, 0, 1, 0, 0] -->
<dim>5</dim>
</port>
<port id="3"> < !-- crops_end value: [0, 0, 1, 0, 0] -->
<port id="3"> <!-- crops_end value: [0, 0, 1, 0, 0] -->
<dim>5</dim>
</port>
</input>
<output>
<port id="3">
<dim>2</dim> < !-- data.shape[0] / (block_shape.shape[0] * block_shape.shape[1] * ... * block_shape.shape[4]) -->
<dim>6</dim> < !-- data.shape[1] * block_shape.shape[1] - crops_begin[1] - crops_end[1]-->
<dim>10</dim> < !-- data.shape[2] * block_shape.shape[2] - crops_begin[2] - crops_end[2] -->
<dim>3</dim> < !-- data.shape[3] * block_shape.shape[3] - crops_begin[3] - crops_end[3] -->
<dim>3</dim> < !-- data.shape[4] * block_shape.shape[4] - crops_begin[4] - crops_end[4] -->
<dim>2</dim> <!-- data.shape[0] / (block_shape.shape[0] * block_shape.shape[1] * ... * block_shape.shape[4]) -->
<dim>6</dim> <!-- data.shape[1] * block_shape.shape[1] - crops_begin[1] - crops_end[1]-->
<dim>10</dim> <!-- data.shape[2] * block_shape.shape[2] - crops_begin[2] - crops_end[2] -->
<dim>3</dim> <!-- data.shape[3] * block_shape.shape[3] - crops_begin[3] - crops_end[3] -->
<dim>3</dim> <!-- data.shape[4] * block_shape.shape[4] - crops_begin[4] - crops_end[4] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ Broadcast
.. meta::
:description: Learn about Broadcast-1 - a data movement operation,
:description: Learn about Broadcast-1 - a data movement operation,
which can be performed on two required and one optional input tensor.
**Versioned name**: *Broadcast-1*
@ -53,7 +53,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
.. code-block:: xml
:force:
<layer ... type="Broadcast" ...>
<data mode="numpy"/>
<input>
@ -63,9 +63,9 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>1</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 16, 50, 50] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 16, 50, 50] -->
</port>
< !-- the 3rd input shouldn't be provided with mode="numpy" -->
<!-- the 3rd input shouldn't be provided with mode="numpy" -->
</input>
<output>
<port id="2">
@ -76,7 +76,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
</port>
</output>
</layer>
<layer ... type="Broadcast" ...>
<data mode="explicit"/>
<input>
@ -84,10 +84,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>16</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 16, 50, 50] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 16, 50, 50] -->
</port>
<port id="1">
<dim>1</dim> < !--The tensor contains 1 elements: [1] -->
<dim>1</dim> <!--The tensor contains 1 elements: [1] -->
</port>
</input>
<output>
@ -99,7 +99,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
</port>
</output>
</layer>
<layer ... type="Broadcast" ...>
<data mode="explicit"/>
<input>
@ -108,10 +108,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>50</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 50, 50, 16] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 50, 50, 16] -->
</port>
<port id="1">
<dim>2</dim> < !--The tensor contains 2 elements: [1, 2] -->
<dim>2</dim> <!--The tensor contains 2 elements: [1, 2] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Broadcast
.. meta::
:description: Learn about Broadcast-3 - a data movement operation,
:description: Learn about Broadcast-3 - a data movement operation,
which can be performed on two required and one optional input tensor.
**Versioned name**: *Broadcast-3*
@ -61,7 +61,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
.. code-block:: xml
:force:
<layer ... type="Broadcast" ...>
<data mode="numpy"/>
<input>
@ -71,9 +71,9 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>1</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 16, 50, 50] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 16, 50, 50] -->
</port>
< !-- the 3rd input shouldn't be provided with mode="numpy" -->
<!-- the 3rd input shouldn't be provided with mode="numpy" -->
</input>
<output>
<port id="2">
@ -84,7 +84,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
</port>
</output>
</layer>
<layer ... type="Broadcast" ...>
<data mode="explicit"/>
<input>
@ -92,10 +92,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>16</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 16, 50, 50] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 16, 50, 50] -->
</port>
<port id="1">
<dim>1</dim> < !--The tensor contains 1 elements: [1] -->
<dim>1</dim> <!--The tensor contains 1 elements: [1] -->
</port>
</input>
<output>
@ -107,7 +107,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
</port>
</output>
</layer>
<layer ... type="Broadcast" ...>
<data mode="explicit"/>
<input>
@ -116,10 +116,10 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>50</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 50, 50, 16] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 50, 50, 16] -->
</port>
<port id="1">
<dim>2</dim> < !--The tensor contains 2 elements: [1, 2] -->
<dim>2</dim> <!--The tensor contains 2 elements: [1, 2] -->
</port>
</input>
<output>
@ -131,7 +131,7 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
</port>
</output>
</layer>
<layer ... type="Broadcast" ...>
<data mode="bidirectional"/>
<input>
@ -141,9 +141,9 @@ For example, ``axes_mapping = [1]`` enables broadcasting of a tensor with shape
<dim>1</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: [1, 1, 50, 50] -->
<dim>4</dim> <!--The tensor contains 4 elements: [1, 1, 50, 50] -->
</port>
< !-- the 3rd input shouldn't be provided with mode="bidirectional" -->
<!-- the 3rd input shouldn't be provided with mode="bidirectional" -->
</input>
<output>
<port id="2">

View File

@ -5,7 +5,7 @@ Concat
.. meta::
:description: Learn about Concat-1 - a data movement operation,
:description: Learn about Concat-1 - a data movement operation,
which can be performed on arbitrary number of input tensors.
**Versioned name**: *Concat-1*
@ -39,25 +39,25 @@ Concat
.. code-block:: xml
:force:
<layer id="1" type="Concat">
<data axis="1" />
<input>
<port id="0">
<dim>1</dim>
<dim>8</dim> < !-- axis for concatenation -->
<dim>8</dim> <!-- axis for concatenation -->
<dim>50</dim>
<dim>50</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>16</dim> < !-- axis for concatenation -->
<dim>16</dim> <!-- axis for concatenation -->
<dim>50</dim>
<dim>50</dim>
</port>
<port id="2">
<dim>1</dim>
<dim>32</dim> < !-- axis for concatenation -->
<dim>32</dim> <!-- axis for concatenation -->
<dim>50</dim>
<dim>50</dim>
</port>
@ -65,7 +65,7 @@ Concat
<output>
<port id="0">
<dim>1</dim>
<dim>56</dim> < !-- concatenated axis: 8 + 16 + 32 = 48 -->
<dim>56</dim> <!-- concatenated axis: 8 + 16 + 32 = 48 -->
<dim>50</dim>
<dim>50</dim>
</port>
@ -75,25 +75,25 @@ Concat
.. code-block:: xml
:force:
<layer id="1" type="Concat">
<data axis="-3" />
<input>
<port id="0">
<dim>1</dim>
<dim>8</dim> < !-- axis for concatenation -->
<dim>8</dim> <!-- axis for concatenation -->
<dim>50</dim>
<dim>50</dim>
</port>
<port id="1">
<dim>1</dim>
<dim>16</dim> < !-- axis for concatenation -->
<dim>16</dim> <!-- axis for concatenation -->
<dim>50</dim>
<dim>50</dim>
</port>
<port id="2">
<dim>1</dim>
<dim>32</dim> < !-- axis for concatenation -->
<dim>32</dim> <!-- axis for concatenation -->
<dim>50</dim>
<dim>50</dim>
</port>
@ -101,7 +101,7 @@ Concat
<output>
<port id="0">
<dim>1</dim>
<dim>56</dim> < !-- concatenated axis: 8 + 16 + 32 = 48 -->
<dim>56</dim> <!-- concatenated axis: 8 + 16 + 32 = 48 -->
<dim>50</dim>
<dim>50</dim>
</port>

View File

@ -5,7 +5,7 @@ DepthToSpace
.. meta::
:description: Learn about DepthToSpace-1 - a data movement operation,
:description: Learn about DepthToSpace-1 - a data movement operation,
which can be performed on a single input tensor.
**Versioned name**: *DepthToSpace-1*
@ -21,7 +21,7 @@ DepthToSpace
The operation is equivalent to the following transformation of the input tensor ``data`` with ``K`` spatial dimensions of shape ``[N, C, D1, D2, ..., DK]`` to *Y* output tensor. If ``mode = blocks_first``:
.. code-block:: cpp
x' = reshape(data, [N, block_size, block_size, ..., block_size, C / (block_size ^ K), D1, D2, ..., DK])
x'' = transpose(x', [0, K + 1, K + 2, 1, K + 3, 2, K + 4, 3, ..., K + (K + 1), K])
y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
@ -29,7 +29,7 @@ The operation is equivalent to the following transformation of the input tensor
If ``mode = depth_first``:
.. code-block:: cpp
x' = reshape(data, [N, C / (block_size ^ K), block_size, block_size, ..., block_size, D1, D2, ..., DK])
x'' = transpose(x', [0, 1, K + 2, 2, K + 3, 3, K + 4, 4, ..., K + (K + 1), K + 1])
y = reshape(x'', [N, C / (block_size ^ K), D1 * block_size, D2 * block_size, D3 * block_size, ..., DK * block_size])
@ -70,7 +70,7 @@ If ``mode = depth_first``:
.. code-block:: xml
:force:
<layer type="DepthToSpace" ...>
<data block_size="2" mode="blocks_first"/>
<input>
@ -83,10 +83,10 @@ If ``mode = depth_first``:
</input>
<output>
<port id="1">
<dim>5</dim> < !-- data.shape[0] -->
<dim>7</dim> < !-- data.shape[1] / (block_size ^ 2) -->
<dim>4</dim> < !-- data.shape[2] * block_size -->
<dim>6</dim> < !-- data.shape[3] * block_size -->
<dim>5</dim> <!-- data.shape[0] -->
<dim>7</dim> <!-- data.shape[1] / (block_size ^ 2) -->
<dim>4</dim> <!-- data.shape[2] * block_size -->
<dim>6</dim> <!-- data.shape[3] * block_size -->
</port>
</output>
</layer>

View File

@ -5,14 +5,14 @@ Gather
.. meta::
:description: Learn about Gather-1 - a data movement operation,
:description: Learn about Gather-1 - a data movement operation,
which can be performed on three required input tensors.
**Versioned name:** *Gather-1*
**Category:** *Data movement*
**Short description:** *Gather* operation takes slices of data in the first input tensor according
**Short description:** *Gather* operation takes slices of data in the first input tensor according
to the indices specified in the second input tensor and axis from the third input.
**Detailed description**
@ -30,13 +30,13 @@ Where ``axis`` is the value from the third input.
* **1**: Tensor with arbitrary data. **Required.**
* **2**: Tensor with indices to gather. The values for indices are in the range ``[0, input1[axis] - 1]``. **Required.**
* **3**: Scalar or 1D tensor *axis* is a dimension index to gather data from. For example, *axis* equal
to 1 means that gathering is performed over the first dimension. Negative value means reverse indexing.
* **3**: Scalar or 1D tensor *axis* is a dimension index to gather data from. For example, *axis* equal
to 1 means that gathering is performed over the first dimension. Negative value means reverse indexing.
Allowed values are from ``[-len(input1.shape), len(input1.shape) - 1]``. **Required.**
**Outputs**
* **1**: The resulting tensor that consists of elements from the first input tensor gathered by indices
* **1**: The resulting tensor that consists of elements from the first input tensor gathered by indices
from the second input tensor. Shape of the tensor is ``[input1.shape[:axis], input2.shape, input1.shape[axis + 1:]]``
**Example**
@ -58,17 +58,17 @@ Where ``axis`` is the value from the third input.
<dim>20</dim>
<dim>28</dim>
</port>
<port id="2"/> < !-- axis = 1 -->
<port id="2"/> <!-- axis = 1 -->
</input>
<output>
<port id="2">
<dim>6</dim> < !-- embedded dimension from the 1st input -->
<dim>15</dim> < !-- embedded dimension from the 2nd input -->
<dim>4</dim> < !-- embedded dimension from the 2nd input -->
<dim>20</dim> < !-- embedded dimension from the 2nd input -->
<dim>28</dim> < !-- embedded dimension from the 2nd input -->
<dim>10</dim> < !-- embedded dimension from the 1st input -->
<dim>24</dim> < !-- embedded dimension from the 1st input -->
<dim>6</dim> <!-- embedded dimension from the 1st input -->
<dim>15</dim> <!-- embedded dimension from the 2nd input -->
<dim>4</dim> <!-- embedded dimension from the 2nd input -->
<dim>20</dim> <!-- embedded dimension from the 2nd input -->
<dim>28</dim> <!-- embedded dimension from the 2nd input -->
<dim>10</dim> <!-- embedded dimension from the 1st input -->
<dim>24</dim> <!-- embedded dimension from the 1st input -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ Gather
.. meta::
:description: Learn about Gather-7 - a data movement operation,
:description: Learn about Gather-7 - a data movement operation,
which can be performed on three required input tensors.
**Versioned name**: *Gather-7*
@ -29,12 +29,12 @@ the number of batch dimensions. ``N`` and ``M`` are numbers of dimensions of ``d
**Attributes**:
* *batch_dims*
* **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data``
tensor and ``indices`` representing the batches, and *Gather* starts to gather from the ``b``
dimension. It requires the first ``b`` dimensions in `data` and `indices` tensors to be equal.
* **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data``
tensor and ``indices`` representing the batches, and *Gather* starts to gather from the ``b``
dimension. It requires the first ``b`` dimensions in `data` and `indices` tensors to be equal.
If ``batch_dims`` is less than zero, the normalized value is used ``batch_dims = indices.rank + batch_dims``.
* **Range of values**: ``[-min(data.rank, indices.rank); min(data.rank, indices.rank)]`` and
* **Range of values**: ``[-min(data.rank, indices.rank); min(data.rank, indices.rank)]`` and
``batch_dims' <= axis'``. Where ``batch_dims'`` and ``axis'`` stand for normalized ``batch_dims`` and ``axis`` values.
* **Type**: *T_AXIS*
* **Default value**: 0
@ -46,7 +46,7 @@ Example 1 with default *batch_dims* value:
batch_dims = 0
axis = 0
indices = [0, 0, 4]
data = [1, 2, 3, 4, 5]
output = [1, 1, 5]
@ -58,15 +58,15 @@ Example 2 with non-default *batch_dims* value:
batch_dims = 1
axis = 1
indices = [[0, 0, 4], <-- this is applied to the first batch
[4, 0, 0]] <-- this is applied to the second batch
indices_shape = (2, 3)
data = [[1, 2, 3, 4, 5], <-- the first batch
[6, 7, 8, 9, 10]] <-- the second batch
data_shape = (2, 5)
output = [[ 1, 1, 5],
[10, 6, 6]]
output_shape = (2, 3)
@ -78,24 +78,24 @@ Example 3 with non-default *batch_dims* value:
batch_dims = 2
axis = 2
indices = [[[0, 0, 4], <-- this is applied to the first batch, index = (0, 0)
[4, 0, 0]], <-- this is applied to the second batch, index = (0, 1)
[[1, 2, 4], <-- this is applied to the third batch, index = (1, 0)
[4, 3, 2]]] <-- this is applied to the fourth batch, index = (1, 1)
indices_shape = (2, 2, 3)
data = [[[1, 2, 3, 4, 5], <-- the first batch, index = (0, 0)
[6, 7, 8, 9, 10]], <-- the second batch, index = (0, 1)
[[11, 12, 13, 14, 15], <-- the third batch, index = (1, 0)
[16, 17, 18, 19, 20]]] <-- the fourth batch, index = (1, 1)
data_shape = (2, 2, 5)
output = [[[ 1, 1, 5],
[10, 6, 6]],
[[12, 13, 15],
[20, 19, 18]]]
output_shape = (2, 2, 3)
@ -106,28 +106,28 @@ Example 4 with *axis* > *batch_dims*:
batch_dims = 1
axis = 2
indices = [[1, 2, 4], <-- this is applied to the first batch
[4, 3, 2]] <-- this is applied to the second batch
indices_shape = (2, 3)
data = [[[[ 1, 2, 3, 4], <-- first batch
[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[13, 14, 15, 16],
[17, 18, 19, 20]]],
[[[21, 22, 23, 24], <-- second batch
[25, 26, 27, 28],
[29, 30, 31, 32],
[33, 34, 35, 36],
[37, 38, 39, 40]]]]
data_shape = (2, 1, 5, 4)
output = [[[[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[17, 18, 19, 20]]],
[[[37, 38, 39, 40],
[33, 34, 35, 36],
[29, 30, 31, 32]]]]
@ -140,15 +140,15 @@ Example 5 with negative *batch_dims* value:
batch_dims = -1 <-- normalized value will be indices.rank + batch_dims = 2 - 1 = 1
axis = 1
indices = [[0, 0, 4], <-- this is applied to the first batch
[4, 0, 0]] <-- this is applied to the second batch
indices_shape = (2, 3)
data = [[1, 2, 3, 4, 5], <-- the first batch
[6, 7, 8, 9, 10]] <-- the second batch
data_shape = (2, 5)
output = [[ 1, 1, 5],
[10, 6, 6]]
output_shape = (2, 3)
@ -167,7 +167,7 @@ Example 5 with negative *batch_dims* value:
**Outputs**
* **1**: The resulting tensor of type *T* that consists of elements from ``data`` tensor gathered by ``indices``.
* **1**: The resulting tensor of type *T* that consists of elements from ``data`` tensor gathered by ``indices``.
The shape of the output tensor is ``data.shape[:axis] + indices.shape[batch_dims:] + data.shape[axis + 1:]``
**Types**
@ -193,7 +193,7 @@ Example 5 with negative *batch_dims* value:
<dim>32</dim>
<dim>21</dim>
</port>
<port id="2"/> < !-- axis = 1 -->
<port id="2"/> <!-- axis = 1 -->
</input>
<output>
<port id="2">

View File

@ -6,7 +6,7 @@ Gather
.. meta::
:description: Learn about Gather-8 - a data movement operation,
:description: Learn about Gather-8 - a data movement operation,
which can be performed on three required input tensors.
**Versioned name**: *Gather-8*
@ -33,10 +33,10 @@ range output data for corresponding index will be filled with zeros (Example 7).
**Attributes**:
* *batch_dims*
* **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data`` tensor
and ``indices`` representing the batches, and *Gather* starts to gather from the ``b`` dimension.
It requires the first ``b`` dimensions in ``data`` and ``indices`` tensors to be equal.
* **Description**: *batch_dims* (also denoted as ``b``) is a leading number of dimensions of ``data`` tensor
and ``indices`` representing the batches, and *Gather* starts to gather from the ``b`` dimension.
It requires the first ``b`` dimensions in ``data`` and ``indices`` tensors to be equal.
If ``batch_dims`` is less than zero, normalized value is used ``batch_dims = indices.rank + batch_dims``.
* **Range of values**: ``[-min(data.rank, indices.rank); min(data.rank, indices.rank)]`` and ``batch_dims' <= axis'``.
Where ``batch_dims'`` and ``axis'`` stand for normalized ``batch_dims`` and ``axis`` values.
@ -50,7 +50,7 @@ Example 1 with default *batch_dims* value:
batch_dims = 0
axis = 0
indices = [0, 0, 4]
data = [1, 2, 3, 4, 5]
output = [1, 1, 5]
@ -61,15 +61,15 @@ Example 2 with non-default *batch_dims* value:
batch_dims = 1
axis = 1
indices = [[0, 0, 4], <-- this is applied to the first batch
[4, 0, 0]] <-- this is applied to the second batch
indices_shape = (2, 3)
data = [[1, 2, 3, 4, 5], <-- the first batch
[6, 7, 8, 9, 10]] <-- the second batch
data_shape = (2, 5)
output = [[ 1, 1, 5],
[10, 6, 6]]
output_shape = (2, 3)
@ -81,24 +81,24 @@ Example 3 with non-default *batch_dims* value:
batch_dims = 2
axis = 2
indices = [[[0, 0, 4], <-- this is applied to the first batch, index = (0, 0)
[4, 0, 0]], <-- this is applied to the second batch, index = (0, 1)
[[1, 2, 4], <-- this is applied to the third batch, index = (1, 0)
[4, 3, 2]]] <-- this is applied to the fourth batch, index = (1, 1)
indices_shape = (2, 2, 3)
data = [[[1, 2, 3, 4, 5], <-- the first batch, index = (0, 0)
[6, 7, 8, 9, 10]], <-- the second batch, index = (0, 1)
[[11, 12, 13, 14, 15], <-- the third batch, index = (1, 0)
[16, 17, 18, 19, 20]]] <-- the fourth batch, index = (1, 1)
data_shape = (2, 2, 5)
output = [[[ 1, 1, 5],
[10, 6, 6]],
[[12, 13, 15],
[20, 19, 18]]]
output_shape = (2, 2, 3)
@ -109,28 +109,28 @@ Example 4 with *axis* > *batch_dims*:
batch_dims = 1
axis = 2
indices = [[1, 2, 4], <-- this is applied to the first batch
[4, 3, 2]] <-- this is applied to the second batch
indices_shape = (2, 3)
data = [[[[ 1, 2, 3, 4], <-- first batch
[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[13, 14, 15, 16],
[17, 18, 19, 20]]],
[[[21, 22, 23, 24], <-- second batch
[25, 26, 27, 28],
[29, 30, 31, 32],
[33, 34, 35, 36],
[37, 38, 39, 40]]]]
data_shape = (2, 1, 5, 4)
output = [[[[ 5, 6, 7, 8],
[ 9, 10, 11, 12],
[17, 18, 19, 20]]],
[[[37, 38, 39, 40],
[33, 34, 35, 36],
[29, 30, 31, 32]]]]
@ -143,15 +143,15 @@ Example 5 with negative *batch_dims* value:
batch_dims = -1 <-- normalized value will be indices.rank + batch_dims = 2 - 1 = 1
axis = 1
indices = [[0, 0, 4], <-- this is applied to the first batch
[4, 0, 0]] <-- this is applied to the second batch
indices_shape = (2, 3)
data = [[1, 2, 3, 4, 5], <-- the first batch
[6, 7, 8, 9, 10]] <-- the second batch
data_shape = (2, 5)
output = [[ 1, 1, 5],
[10, 6, 6]]
output_shape = (2, 3)
@ -163,7 +163,7 @@ Example 6 with negative indices:
batch_dims = 0
axis = 0
indices = [0, -2, -1]
data = [1, 2, 3, 4, 5]
output = [1, 4, 5]
@ -175,8 +175,8 @@ Example 7 with indices out of the range:
batch_dims = 0
axis = 0
indices = [3, 10, -20]
indices = [3, 10, -20]
data = [1, 2, 3, 4, 5]
output = [4, 0, 0]
@ -221,7 +221,7 @@ of the output tensor is ``data.shape[:axis] + indices.shape[batch_dims:] + data.
<dim>32</dim>
<dim>21</dim>
</port>
<port id="2"/> < !-- axis = 1 -->
<port id="2"/> <!-- axis = 1 -->
</input>
<output>
<port id="2">

View File

@ -5,7 +5,7 @@ Pad
.. meta::
:description: Learn about Pad-1 - a data movement operation,
:description: Learn about Pad-1 - a data movement operation,
which can be performed on three required and one optional input tensor.
**Versioned name**: *Pad-1*
@ -26,7 +26,7 @@ The following examples illustrate how output tensor is generated for the *Pad* l
[ 9 10 11 12 ]]
with the following attributes:
with the following attributes:
.. code-block:: cpp
@ -36,7 +36,7 @@ with the following attributes:
depending on the *pad_mode*.
* ``pad_mode = "constant"``:
* ``pad_mode = "constant"``:
.. code-block:: cpp
@ -48,7 +48,7 @@ depending on the *pad_mode*.
[ 0 0 0 0 0 0 0 0 ]]
* ``pad_mode = "edge"``:
* ``pad_mode = "edge"``:
.. code-block:: cpp
@ -121,7 +121,7 @@ depending on the *pad_mode*.
**Example**: constant mode
.. code-block:: xml
:force:
:force:
<layer ... type="Pad" ...>
<data pad_mode="constant"/>
@ -133,22 +133,22 @@ depending on the *pad_mode*.
<dim>40</dim>
</port>
<port id="1">
<dim>4</dim> < !-- pads_begin = [0, 5, 2, 1] -->
<dim>4</dim> <!-- pads_begin = [0, 5, 2, 1] -->
</port>
<port id="2">
<dim>4</dim> < !-- pads_end = [1, 0, 3, 7] -->
<dim>4</dim> <!-- pads_end = [1, 0, 3, 7] -->
</port>
<port id="3">
< !-- pad_value = 15.0 -->
<!-- pad_value = 15.0 -->
</port>
</input>
<output>
<port id="0">
<dim>2</dim> < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
< !-- all new elements are filled with 15.0 value -->
<dim>2</dim> <!-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> <!-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> <!-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> <!-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
<!-- all new elements are filled with 15.0 value -->
</port>
</output>
</layer>
@ -169,18 +169,18 @@ depending on the *pad_mode*.
<dim>40</dim>
</port>
<port id="1">
<dim>4</dim> < !-- pads_begin = [0, 5, 2, 1] -->
<dim>4</dim> <!-- pads_begin = [0, 5, 2, 1] -->
</port>
<port id="2">
<dim>4</dim> < !-- pads_end = [1, 0, 3, 7] -->
<dim>4</dim> <!-- pads_end = [1, 0, 3, 7] -->
</port>
</input>
<output>
<port id="0">
<dim>2</dim> < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
<dim>2</dim> <!-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> <!-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> <!-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> <!-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ Pad
.. meta::
:description: Learn about Pad-12 - a data movement operation,
:description: Learn about Pad-12 - a data movement operation,
which can be performed on three required and one optional input tensor.
**Versioned name**: *Pad-12*
@ -19,7 +19,7 @@ Pad
The following examples illustrate how output tensor is generated for the *Pad* layer for a given inputs:
Positive pads example:
########################
########################
.. code-block:: cpp
@ -82,7 +82,7 @@ depending on the *pad_mode* attribute:
Negative pads example:
#########################
#########################
.. code-block:: cpp
@ -111,7 +111,7 @@ for all of the *pad_mode* attribute options:
Mixed pads example:
########################
########################
.. code-block:: cpp
@ -178,7 +178,7 @@ Mixed pads example:
* **Description**: *pad_mode* specifies the method used to generate the padding values.
* **Range of values**: Name of the method in string format:
* ``constant`` - padded values are taken from the *pad_value* input. If the input is not provided, the padding elements are equal to zero.
* ``edge`` - padded values are copied from the respective edge of the input ``data`` tensor.
* ``reflect`` - padded values are a reflection of the input `data` tensor. Values on the edges are not duplicated, ``pads_begin[D]`` and ``pads_end[D]`` must be not greater than ``data.shape[D] 1`` for any valid ``D``.
@ -223,22 +223,22 @@ Mixed pads example:
<dim>40</dim>
</port>
<port id="1">
<dim>4</dim> < !-- pads_begin = [0, 5, 2, 1] -->
<dim>4</dim> <!-- pads_begin = [0, 5, 2, 1] -->
</port>
<port id="2">
<dim>4</dim> < !-- pads_end = [1, 0, 3, 7] -->
<dim>4</dim> <!-- pads_end = [1, 0, 3, 7] -->
</port>
<port id="3">
< !-- pad_value = 15.0 -->
<!-- pad_value = 15.0 -->
</port>
</input>
<output>
<port id="0">
<dim>2</dim> < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
< !-- all new elements are filled with 15.0 value -->
<dim>2</dim> <!-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> <!-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> <!-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> <!-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
<!-- all new elements are filled with 15.0 value -->
</port>
</output>
</layer>
@ -247,7 +247,7 @@ Mixed pads example:
**Example**: constant mode (positive and negative pads)
.. code-block:: xml
:force:
:force:
<layer ... type="Pad" ...>
<data pad_mode="constant"/>
@ -259,22 +259,22 @@ Mixed pads example:
<dim>40</dim>
</port>
<port id="1">
<dim>4</dim> < !-- pads_begin = [0, -2, -8, 1] -->
<dim>4</dim> <!-- pads_begin = [0, -2, -8, 1] -->
</port>
<port id="2">
<dim>4</dim> < !-- pads_end = [-1, 4, -6, 7] -->
<dim>4</dim> <!-- pads_end = [-1, 4, -6, 7] -->
</port>
<port id="3">
< !-- pad_value = 15.0 -->
<!-- pad_value = 15.0 -->
</port>
</input>
<output>
<port id="0">
<dim>1</dim> < !-- 2 = 0 + 2 + (-1) = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>5</dim> < !-- 5 = (-2) + 3 + 4 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>18</dim> < !-- 18 = (-8) + 32 (-6) = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
< !-- all new elements are filled with 15.0 value -->
<dim>1</dim> <!-- 2 = 0 + 2 + (-1) = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>5</dim> <!-- 5 = (-2) + 3 + 4 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>18</dim> <!-- 18 = (-8) + 32 (-6) = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> <!-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
<!-- all new elements are filled with 15.0 value -->
</port>
</output>
</layer>
@ -283,7 +283,7 @@ Mixed pads example:
**Example**: edge mode
.. code-block:: xml
:force:
:force:
<layer ... type="Pad" ...>
<data pad_mode="edge"/>
@ -295,18 +295,18 @@ Mixed pads example:
<dim>40</dim>
</port>
<port id="1">
<dim>4</dim> < !-- pads_begin = [0, 5, 2, 1] -->
<dim>4</dim> <!-- pads_begin = [0, 5, 2, 1] -->
</port>
<port id="2">
<dim>4</dim> < !-- pads_end = [1, 0, 3, 7] -->
<dim>4</dim> <!-- pads_end = [1, 0, 3, 7] -->
</port>
</input>
<output>
<port id="0">
<dim>2</dim> < !-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> < !-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> < !-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> < !-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
<dim>2</dim> <!-- 2 = 0 + 1 + 1 = pads_begin[0] + input.shape[0] + pads_end[0] -->
<dim>8</dim> <!-- 8 = 5 + 3 + 0 = pads_begin[1] + input.shape[1] + pads_end[1] -->
<dim>37</dim> <!-- 37 = 2 + 32 + 3 = pads_begin[2] + input.shape[2] + pads_end[2] -->
<dim>48</dim> <!-- 48 = 1 + 40 + 7 = pads_begin[3] + input.shape[3] + pads_end[3] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ ReverseSequence
.. meta::
:description: Learn about ReverseSequence-1 - a data movement operation,
:description: Learn about ReverseSequence-1 - a data movement operation,
which can be performed on two required input tensors.
**Versioned name**: *ReverseSequence-1*
@ -58,14 +58,14 @@ ReverseSequence
<layer ... type="ReverseSequence">
<data batch_axis="0" seq_axis="1"/>
<input>
<port id="0"> < !-- data -->
<dim>4</dim> < !-- batch_axis -->
<dim>10</dim> < !-- seq_axis -->
<port id="0"> <!-- data -->
<dim>4</dim> <!-- batch_axis -->
<dim>10</dim> <!-- seq_axis -->
<dim>100</dim>
<dim>200</dim>
</port>
<port id="1">
<dim>4</dim> < !-- seq_lengths value: [2, 4, 8, 10] -->
<dim>4</dim> <!-- seq_lengths value: [2, 4, 8, 10] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Reverse
.. meta::
:description: Learn about Reverse-1 - a data movement operation,
:description: Learn about Reverse-1 - a data movement operation,
which can be performed on one required and one optional input tensor.
**Versioned name**: *Reverse-1*
@ -62,7 +62,7 @@ If no axis specified, that means either the second input is empty if ``index`` m
<dim>200</dim>
</port>
<port id="1">
<dim>1</dim> < !-- reverting along single axis -->
<dim>1</dim> <!-- reverting along single axis -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Roll
.. meta::
:description: Learn about Roll-7 - a data movement operation, which can be
:description: Learn about Roll-7 - a data movement operation, which can be
performed on three required input tensors.
**Versioned name**: *Roll-7*
@ -100,7 +100,7 @@ No attributes available.
<dim>2</dim>
</port>
<port id="2">
<dim>2</dim> < !-- shifting along specified axes with the corresponding shift values -->
<dim>2</dim> <!-- shifting along specified axes with the corresponding shift values -->
</port>
</input>
<output>
@ -131,7 +131,7 @@ No attributes available.
<dim>1</dim>
</port>
<port id="2">
<dim>2</dim> < !-- shifting along specified axes with the same shift value -->
<dim>2</dim> <!-- shifting along specified axes with the same shift value -->
</port>
</input>
<output>

View File

@ -130,22 +130,22 @@ Accordingly for 3D tensor case, the update of the element corresponding to the `
<layer ... use_init_val="true" reduction="sum" type="ScatterElementsUpdate">
<input>
<port id="0">> < !-- data -->
<dim>4</dim> < !-- values: [2, 3, 4, 6] -->
<port id="0">> <!-- data -->
<dim>4</dim> <!-- values: [2, 3, 4, 6] -->
</port>
<port id="1"> < !-- indices (negative values allowed) -->
<dim>6</dim> < !-- values: [1, 0, 0, -2, -1, 2] -->
<port id="1"> <!-- indices (negative values allowed) -->
<dim>6</dim> <!-- values: [1, 0, 0, -2, -1, 2] -->
</port>
<port id="2">> < !-- updates -->
<dim>6</dim> < !-- values: [10, 20, 30, 40, 70, 60] -->
<port id="2">> <!-- updates -->
<dim>6</dim> <!-- values: [10, 20, 30, 40, 70, 60] -->
</port>
<port id="3"> < !-- values: [0] -->
<port id="3"> <!-- values: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="4" precision="FP32">
<dim>4</dim> < !-- values: [52, 13, 104, 76] -->
<dim>4</dim> <!-- values: [52, 13, 104, 76] -->
</port>
</output>
</layer>
@ -157,22 +157,22 @@ Accordingly for 3D tensor case, the update of the element corresponding to the `
<layer ... use_init_val="false" reduction="sum" type="ScatterElementsUpdate">
<input>
<port id="0">> < !-- data -->
<dim>4</dim> < !-- values: [2, 3, 4, 6] -->
<port id="0">> <!-- data -->
<dim>4</dim> <!-- values: [2, 3, 4, 6] -->
</port>
<port id="1"> < !-- indices -->
<dim>6</dim> < !-- values: [1, 0, 0, 2, 3, 2] -->
<port id="1"> <!-- indices -->
<dim>6</dim> <!-- values: [1, 0, 0, 2, 3, 2] -->
</port>
<port id="2">> < !-- updates -->
<dim>6</dim> < !-- values: [10, 20, 30, 40, 70, 60] -->
<port id="2">> <!-- updates -->
<dim>6</dim> <!-- values: [10, 20, 30, 40, 70, 60] -->
</port>
<port id="3"> < !-- values: [0] -->
<port id="3"> <!-- values: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="4" precision="FP32">
<dim>4</dim> < !-- values: [50, 10, 100, 70] -->
<dim>4</dim> <!-- values: [50, 10, 100, 70] -->
</port>
</output>
</layer>
@ -184,30 +184,30 @@ Accordingly for 3D tensor case, the update of the element corresponding to the `
<layer ... use_init_val="true" reduction="none" type="ScatterElementsUpdate">
<input>
<port id="0">> < !-- data -->
<port id="0">> <!-- data -->
<dim>3</dim>
<dim>4</dim> < !-- values: [[0, 0, 0, 0],
<dim>4</dim> <!-- values: [[0, 0, 0, 0],
[0, 0, 0, 0],
[0, 0, 0, 0]] -->
</port>
<port id="1"> < !-- indices -->
<port id="1"> <!-- indices -->
<dim>2</dim>
<dim>2</dim> < !-- values: [[1, 2],
<dim>2</dim> <!-- values: [[1, 2],
[0, 3]] -->
</port>
<port id="2">> < !-- updates -->
<port id="2">> <!-- updates -->
<dim>2</dim>
<dim>2</dim> < !-- values: [[11, 12],
<dim>2</dim> <!-- values: [[11, 12],
[13, 14]]) -->
</port>
<port id="3"> < !-- values: [1] -->
<port id="3"> <!-- values: [1] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="4" precision="I32">
<dim>3</dim>
<dim>4</dim> < !-- values: [[ 0, 11, 12, 0],
<dim>4</dim> <!-- values: [[ 0, 11, 12, 0],
[13, 0, 0, 14],
[ 0, 0, 0, 0]] -->
</port>
@ -221,30 +221,30 @@ Accordingly for 3D tensor case, the update of the element corresponding to the `
<layer ... use_init_val="true" reduction="sum" type="ScatterElementsUpdate">
<input>
<port id="0">> < !-- data -->
<port id="0">> <!-- data -->
<dim>3</dim>
<dim>4</dim> < !-- values: [[1, 1, 1, 1],
<dim>4</dim> <!-- values: [[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 1]] -->
</port>
<port id="1"> < !-- indices -->
<port id="1"> <!-- indices -->
<dim>2</dim>
<dim>2</dim> < !-- values: [[1, 1],
<dim>2</dim> <!-- values: [[1, 1],
[0, 3]] -->
</port>
<port id="2">> < !-- updates -->
<port id="2">> <!-- updates -->
<dim>2</dim>
<dim>2</dim> < !-- values: [[11, 12],
<dim>2</dim> <!-- values: [[11, 12],
[13, 14]]) -->
</port>
<port id="3"> < !-- values: [1] -->
<port id="3"> <!-- values: [1] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="4" precision="I32">
<dim>3</dim>
<dim>4</dim> < !-- values: [[ 1, 24, 1, 1],
<dim>4</dim> <!-- values: [[ 1, 24, 1, 1],
[14, 1, 1, 15],
[ 1, 1, 1, 1]] -->
</port>
@ -258,30 +258,30 @@ Accordingly for 3D tensor case, the update of the element corresponding to the `
<layer ... use_init_val="true" reduction="prod" type="ScatterElementsUpdate">
<input>
<port id="0">> < !-- data -->
<port id="0">> <!-- data -->
<dim>3</dim>
<dim>4</dim> < !-- values: [[2, 2, 2, 2],
<dim>4</dim> <!-- values: [[2, 2, 2, 2],
[2, 2, 2, 2],
[2, 2, 2, 2]] -->
</port>
<port id="1"> < !-- indices -->
<port id="1"> <!-- indices -->
<dim>2</dim>
<dim>2</dim> < !-- values: [[1, 1],
<dim>2</dim> <!-- values: [[1, 1],
[0, 3]] -->
</port>
<port id="2">> < !-- updates -->
<port id="2">> <!-- updates -->
<dim>2</dim>
<dim>2</dim> < !-- values: [[11, 12],
<dim>2</dim> <!-- values: [[11, 12],
[13, 14]]) -->
</port>
<port id="3"> < !-- values: [1] -->
<port id="3"> <!-- values: [1] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="4" precision="I32">
<dim>3</dim>
<dim>4</dim> < !-- values: [[ 2, 264, 2, 2],
<dim>4</dim> <!-- values: [[ 2, 264, 2, 2],
[ 26, 2, 2, 28],
[ 2, 2, 2, 2]] -->
</port>
@ -313,7 +313,7 @@ Accordingly for 3D tensor case, the update of the element corresponding to the `
<dim>7</dim>
<dim>6</dim>
</port>
<port id="3"> < !-- values: [0] -->
<port id="3"> <!-- values: [0] -->
<dim>1</dim>
</port>
</input>

View File

@ -5,7 +5,7 @@ ScatterElementsUpdate
.. meta::
:description: Learn about ScatterElementsUpdate-3 - a data movement operation, which can be
:description: Learn about ScatterElementsUpdate-3 - a data movement operation, which can be
performed on four required input tensors.
**Versioned name**: *ScatterElementsUpdate-3*
@ -81,7 +81,7 @@ The value can be in range ``[-r, r - 1]`` where ``r`` is the rank of ``data``. *
<dim>7</dim>
<dim>6</dim>
</port>
<port id="3"> < !-- value [0] -->
<port id="3"> <!-- value [0] -->
<dim>1</dim>
</port>
</input>

View File

@ -5,7 +5,7 @@ ScatterUpdate
.. meta::
:description: Learn about ScatterUpdate-3 - a data movement operation, which can be
:description: Learn about ScatterUpdate-3 - a data movement operation, which can be
performed on four required input tensors.
**Versioned name**: *ScatterUpdate-3*
@ -35,14 +35,14 @@ Several examples for case when `axis = 0`:
* **1**: ``data`` tensor of arbitrary rank ``r`` and type *T_NUMERIC*. **Required.**
* **2**: ``indices`` tensor with indices of type *T_IND*. All index values are expected to be within bounds ``[0, s - 1]`` along the axis of size ``s``. If multiple indices point to the
same output location, the order of updating the values is undefined. If an index points to a non-existing output
tensor element or is negative, then an exception is raised. **Required.**
* **2**: ``indices`` tensor with indices of type *T_IND*. All index values are expected to be within bounds ``[0, s - 1]`` along the axis
of size ``s``. If multiple indices point to the same output location, the order of updating the values is undefined.
If an index points to a non-existing output tensor element or is negative, then an exception is raised. **Required.**
* **3**: ``updates`` tensor of type *T_NUMERIC* and rank equal to ``rank(indices) + rank(data) - 1`` **Required.**
* **4**: ``axis`` tensor with scalar or 1D tensor with one element of type *T_AXIS* specifying axis for scatter.
The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``data``. **Required.**
The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``data``. **Required.**
**Outputs**:
@ -65,29 +65,29 @@ The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``dat
<layer ... type="ScatterUpdate">
<input>
<port id="0"> < !-- data -->
<port id="0"> <!-- data -->
<dim>1000</dim>
<dim>256</dim>
<dim>10</dim>
<dim>15</dim>
</port>
<port id="1"> < !-- indices -->
<port id="1"> <!-- indices -->
<dim>125</dim>
<dim>20</dim>
</port>
<port id="2"> < !-- updates -->
<port id="2"> <!-- updates -->
<dim>1000</dim>
<dim>125</dim>
<dim>20</dim>
<dim>10</dim>
<dim>15</dim>
</port>
<port id="3"> < !-- axis -->
<dim>1</dim> < !-- value [1] -->
<port id="3"> <!-- axis -->
<dim>1</dim> <!-- value [1] -->
</port>
</input>
<output>
<port id="4" precision="FP32"> < !-- output -->
<port id="4" precision="FP32"> <!-- output -->
<dim>1000</dim>
<dim>256</dim>
<dim>10</dim>
@ -103,26 +103,26 @@ The value can be in the range ``[ -r, r - 1]``, where ``r`` is the rank of ``dat
<layer ... type="ScatterUpdate">
<input>
<port id="0"> < !-- data -->
<dim>3</dim> < !-- {{-1.0f, 1.0f, -1.0f, 3.0f, 4.0f}, -->
<dim>5</dim> < !-- {-1.0f, 6.0f, -1.0f, 8.0f, 9.0f}, -->
</port> < !-- {-1.0f, 11.0f, 1.0f, 13.0f, 14.0f}} -->
<port id="1"> < !-- indices -->
<dim>2</dim> < !-- {0, 2} -->
<port id="0"> <!-- data -->
<dim>3</dim> <!-- {{-1.0f, 1.0f, -1.0f, 3.0f, 4.0f}, -->
<dim>5</dim> <!-- {-1.0f, 6.0f, -1.0f, 8.0f, 9.0f}, -->
</port> <!-- {-1.0f, 11.0f, 1.0f, 13.0f, 14.0f}} -->
<port id="1"> <!-- indices -->
<dim>2</dim> <!-- {0, 2} -->
</port>
<port id="2"> < !-- updates -->
<dim>3</dim> < !-- {1.0f, 1.0f} -->
<dim>2</dim> < !-- {1.0f, 1.0f} -->
</port> < !-- {1.0f, 2.0f} -->
<port id="3"> < !-- axis -->
<dim>1</dim> < !-- {1} -->
<port id="2"> <!-- updates -->
<dim>3</dim> <!-- {1.0f, 1.0f} -->
<dim>2</dim> <!-- {1.0f, 1.0f} -->
</port> <!-- {1.0f, 2.0f} -->
<port id="3"> <!-- axis -->
<dim>1</dim> <!-- {1} -->
</port>
</input>
<output>
<port id="4"> < !-- output -->
<dim>3</dim> < !-- {{1.0f, 1.0f, 1.0f, 3.0f, 4.0f}, -->
<dim>5</dim> < !-- {1.0f, 6.0f, 1.0f, 8.0f, 9.0f}, -->
</port> < !-- {1.0f, 11.0f, 2.0f, 13.0f, 14.0f}} -->
<port id="4"> <!-- output -->
<dim>3</dim> <!-- {{1.0f, 1.0f, 1.0f, 3.0f, 4.0f}, -->
<dim>5</dim> <!-- {1.0f, 6.0f, 1.0f, 8.0f, 9.0f}, -->
</port> <!-- {1.0f, 11.0f, 2.0f, 13.0f, 14.0f}} -->
</output>
</layer>

View File

@ -5,7 +5,7 @@ Slice
.. meta::
:description: Learn about Slice-8 - a data movement operation,
:description: Learn about Slice-8 - a data movement operation,
which can be performed on four required and one optional input tensor.
**Versioned name**: *Slice-8*
@ -82,24 +82,24 @@ Example 1: basic slicing
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [1] -->
<port id="1"> <!-- start: [1] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [8] -->
<port id="2"> <!-- stop: [8] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [1] -->
<port id="3"> <!-- step: [1] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [1, 2, 3, 4, 5, 6, 7] -->
<port id="5"> <!-- output: [1, 2, 3, 4, 5, 6, 7] -->
<dim>7</dim>
</port>
</output>
@ -113,21 +113,21 @@ Example 2: basic slicing, ``axes`` default
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [1] -->
<port id="1"> <!-- start: [1] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [8] -->
<port id="2"> <!-- stop: [8] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [1] -->
<port id="3"> <!-- step: [1] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="4"> < !-- output: [1, 2, 3, 4, 5, 6, 7] -->
<port id="4"> <!-- output: [1, 2, 3, 4, 5, 6, 7] -->
<dim>7</dim>
</port>
</output>
@ -141,24 +141,24 @@ Example 3: basic slicing, ``step: [2]``
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [1] -->
<port id="1"> <!-- start: [1] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [8] -->
<port id="2"> <!-- stop: [8] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [2] -->
<port id="3"> <!-- step: [2] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [1, 3, 5, 7] -->
<port id="5"> <!-- output: [1, 3, 5, 7] -->
<dim>4</dim>
</port>
</output>
@ -171,24 +171,24 @@ Example 4: ``start`` and ``stop`` out of the dimension size, ``step: [1]``
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [-100] -->
<port id="1"> <!-- start: [-100] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [100] -->
<port id="2"> <!-- stop: [100] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [1] -->
<port id="3"> <!-- step: [1] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="5"> <!-- output: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
</output>
@ -202,24 +202,24 @@ Example 5: slicing backward all elements, ``step: [-1]``, ``stop: [-11]``
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [9] -->
<port id="1"> <!-- start: [9] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [-11] -->
<port id="2"> <!-- stop: [-11] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [-1] -->
<port id="3"> <!-- step: [-1] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] -->
<port id="5"> <!-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] -->
<dim>10</dim>
</port>
</output>
@ -233,29 +233,29 @@ Example 6: slicing backward, ``step: [-1]``, ``stop: [0]``
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [9] -->
<port id="1"> <!-- start: [9] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [0] -->
<port id="2"> <!-- stop: [0] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [-1] -->
<port id="3"> <!-- step: [-1] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] -->
<port id="5"> <!-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] -->
<dim>9</dim>
</port>
</output>
</layer>
Example 7: slicing backward, ``step: [-1]``, ``stop: [-10]``
@ -264,24 +264,24 @@ Example 7: slicing backward, ``step: [-1]``, ``stop: [-10]``
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [9] -->
<port id="1"> <!-- start: [9] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [-10] -->
<port id="2"> <!-- stop: [-10] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [-1] -->
<port id="3"> <!-- step: [-1] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] -->
<port id="5"> <!-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1] -->
<dim>9</dim>
</port>
</output>
@ -295,24 +295,24 @@ Example 8: slicing backward, ``step: [-2]``
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [9] -->
<port id="1"> <!-- start: [9] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [-11] -->
<port id="2"> <!-- stop: [-11] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [-2] -->
<port id="3"> <!-- step: [-2] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [9, 7, 5, 3, 1] -->
<port id="5"> <!-- output: [9, 7, 5, 3, 1] -->
<dim>5</dim>
</port>
</output>
@ -326,24 +326,24 @@ Example 9: ``start`` and ``stop`` out of the dimension size, slicing backward
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<port id="0"> <!-- data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] -->
<dim>10</dim>
</port>
<port id="1"> < !-- start: [100] -->
<port id="1"> <!-- start: [100] -->
<dim>1</dim>
</port>
<port id="2"> < !-- stop: [-100] -->
<port id="2"> <!-- stop: [-100] -->
<dim>1</dim>
</port>
<port id="3"> < !-- step: [-1] -->
<port id="3"> <!-- step: [-1] -->
<dim>1</dim>
</port>
<port id="4"> < !-- axes: [0] -->
<port id="4"> <!-- axes: [0] -->
<dim>1</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] -->
<port id="5"> <!-- output: [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] -->
<dim>10</dim>
</port>
</output>
@ -357,31 +357,31 @@ Example 10: slicing 2D tensor, all axes specified
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data: data: [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] -->
<port id="0"> <!-- data: data: [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]] -->
<dim>2</dim>
<dim>5</dim>
</port>
<port id="1"> < !-- start: [0, 1] -->
<port id="1"> <!-- start: [0, 1] -->
<dim>2</dim>
</port>
<port id="2"> < !-- stop: [2, 4] -->
<port id="2"> <!-- stop: [2, 4] -->
<dim>2</dim>
</port>
<port id="3"> < !-- step: [1, 2] -->
<port id="3"> <!-- step: [1, 2] -->
<dim>2</dim>
</port>
<port id="4"> < !-- axes: [0, 1] -->
<port id="4"> <!-- axes: [0, 1] -->
<dim>2</dim>
</port>
</input>
<output>
<port id="5"> < !-- output: [1, 3, 6, 8] -->
<port id="5"> <!-- output: [1, 3, 6, 8] -->
<dim>2</dim>
<dim>2</dim>
</port>
</output>
</layer>
Example 11: slicing 3D tensor, all axes specified
@ -390,26 +390,26 @@ Example 11: slicing 3D tensor, all axes specified
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data -->
<port id="0"> <!-- data -->
<dim>20</dim>
<dim>10</dim>
<dim>5</dim>
</port>
<port id="1"> < !-- start: [0, 0, 0] -->
<port id="1"> <!-- start: [0, 0, 0] -->
<dim>2</dim>
</port>
<port id="2"> < !-- stop: [4, 10, 5] -->
<port id="2"> <!-- stop: [4, 10, 5] -->
<dim>2</dim>
</port>
<port id="3"> < !-- step: [1, 1, 1] -->
<port id="3"> <!-- step: [1, 1, 1] -->
<dim>2</dim>
</port>
<port id="4"> < !-- axes: [0, 1, 2] -->
<port id="4"> <!-- axes: [0, 1, 2] -->
<dim>2</dim>
</port>
</input>
<output>
<port id="5"> < !-- output -->
<port id="5"> <!-- output -->
<dim>4</dim>
<dim>10</dim>
<dim>5</dim>
@ -424,26 +424,26 @@ Example 12: slicing 3D tensor, last axes default
<layer id="1" type="Slice" ...>
<input>
<port id="0"> < !-- data -->
<port id="0"> <!-- data -->
<dim>20</dim>
<dim>10</dim>
<dim>5</dim>
</port>
<port id="1"> < !-- start: [0, 0] -->
<port id="1"> <!-- start: [0, 0] -->
<dim>2</dim>
</port>
<port id="2"> < !-- stop: [4, 10] -->
<port id="2"> <!-- stop: [4, 10] -->
<dim>2</dim>
</port>
<port id="3"> < !-- step: [1, 1] -->
<port id="3"> <!-- step: [1, 1] -->
<dim>2</dim>
</port>
<port id="4"> < !-- axes: [0, 1] -->
<port id="4"> <!-- axes: [0, 1] -->
<dim>2</dim>
</port>
</input>
<output>
<port id="5"> < !-- output -->
<port id="5"> <!-- output -->
<dim>4</dim>
<dim>10</dim>
<dim>5</dim>

View File

@ -5,7 +5,7 @@ SpaceToBatch
.. meta::
:description: Learn about SpaceToBatch-2 - a data movement operation,
:description: Learn about SpaceToBatch-2 - a data movement operation,
which can be performed on four required input tensors.
**Versioned name**: *SpaceToBatch-2*
@ -79,30 +79,30 @@ No attributes available.
<layer type="SpaceToBatch" ...>
<input>
<port id="0"> < !-- data -->
<dim>2</dim> < !-- batch -->
<dim>6</dim> < !-- spatial dimension 1 -->
<dim>10</dim> < !-- spatial dimension 2 -->
<dim>3</dim> < !-- spatial dimension 3 -->
<dim>3</dim> < !-- spatial dimension 4 -->
<port id="0"> <!-- data -->
<dim>2</dim> <!-- batch -->
<dim>6</dim> <!-- spatial dimension 1 -->
<dim>10</dim> <!-- spatial dimension 2 -->
<dim>3</dim> <!-- spatial dimension 3 -->
<dim>3</dim> <!-- spatial dimension 4 -->
</port>
<port id="1"> < !-- block_shape value: [1, 2, 4, 3, 1] -->
<port id="1"> <!-- block_shape value: [1, 2, 4, 3, 1] -->
<dim>5</dim>
</port>
<port id="2"> < !-- pads_begin value: [0, 0, 1, 0, 0] -->
<port id="2"> <!-- pads_begin value: [0, 0, 1, 0, 0] -->
<dim>5</dim>
</port>
<port id="3"> < !-- pads_end value: [0, 0, 1, 0, 0] -->
<port id="3"> <!-- pads_end value: [0, 0, 1, 0, 0] -->
<dim>5</dim>
</port>
</input>
<output>
<port id="3">
<dim>48</dim> < !-- data.shape[0] * block_shape.shape[0] * block_shape.shape[1] *... * block_shape.shape[4] -->
<dim>3</dim> < !-- (data.shape[1] + pads_begin[1] + pads_end[1]) / block_shape.shape[1] -->
<dim>3</dim> < !-- (data.shape[2] + pads_begin[2] + pads_end[2]) / block_shape.shape[2] -->
<dim>1</dim> < !-- (data.shape[3] + pads_begin[3] + pads_end[3]) / block_shape.shape[3] -->
<dim>3</dim> < !-- (data.shape[4] + pads_begin[4] + pads_end[4]) / block_shape.shape[4] -->
<dim>48</dim> <!-- data.shape[0] * block_shape.shape[0] * block_shape.shape[1] *... * block_shape.shape[4] -->
<dim>3</dim> <!-- (data.shape[1] + pads_begin[1] + pads_end[1]) / block_shape.shape[1] -->
<dim>3</dim> <!-- (data.shape[2] + pads_begin[2] + pads_end[2]) / block_shape.shape[2] -->
<dim>1</dim> <!-- (data.shape[3] + pads_begin[3] + pads_end[3]) / block_shape.shape[3] -->
<dim>3</dim> <!-- (data.shape[4] + pads_begin[4] + pads_end[4]) / block_shape.shape[4] -->
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ Split
.. meta::
:description: Learn about Split-1 - a data movement operation,
:description: Learn about Split-1 - a data movement operation,
which can be performed on two required input tensors.
**Versioned name**: *Split-1*
@ -58,13 +58,13 @@ Where D is the rank of input tensor ``data``. The axis being split must be evenl
<layer id="1" type="Split" ...>
<data num_splits="3" />
<input>
<port id="0"> < !-- some data -->
<port id="0"> <!-- some data -->
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1"> < !-- axis: 1 -->
<port id="1"> <!-- axis: 1 -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ StridedSlice
.. meta::
:description: Learn about StridedSlice-1 - a data movement operation,
:description: Learn about StridedSlice-1 - a data movement operation,
which can be performed on three required and one optional input tensor.
**Versioned name**: *StridedSlice-1*
@ -88,13 +88,13 @@ Example of ``begin_mask`` & ``end_mask`` usage.
<dim>4</dim>
</port>
<port id="1">
<dim>2</dim> < !-- begin: [1, 0, 0] -->
<dim>2</dim> <!-- begin: [1, 0, 0] -->
</port>
<port id="2">
<dim>2</dim> < !-- end: [0, 0, 2] -->
<dim>2</dim> <!-- end: [0, 0, 2] -->
</port>
<port id="3">
<dim>2</dim> < !-- stride: [1, 1, 1] -->
<dim>2</dim> <!-- stride: [1, 1, 1] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Tile
.. meta::
:description: Learn about Tile-1 - a data movement operation, which can be
:description: Learn about Tile-1 - a data movement operation, which can be
performed on two required input tensors.
**Versioned name**: *Tile-1*
@ -39,10 +39,10 @@ No attributes available.
*Tile* operation extends input tensor and filling in output tensor by the following rules:
.. math::
.. math::
out_i=input_i[inner_dim*t]
.. math::
t \in \left ( 0, \quad tiles \right )
@ -62,7 +62,7 @@ No attributes available.
<dim>4</dim>
</port>
<port id="1">
<dim>3</dim> < !-- [1, 2, 3] -->
<dim>3</dim> <!-- [1, 2, 3] -->
</port>
</input>
<output>
@ -81,13 +81,13 @@ No attributes available.
<layer ... type="Tile">
<input>
<port id="0"> < !-- will be promoted to shape (1, 2, 3, 4) -->
<port id="0"> <!-- will be promoted to shape (1, 2, 3, 4) -->
<dim>2</dim>
<dim>3</dim>
<dim>4</dim>
</port>
<port id="1">
<dim>4</dim> < !-- [5, 1, 2, 3] -->
<dim>4</dim> <!-- [5, 1, 2, 3] -->
</port>
</input>
<output>
@ -114,7 +114,7 @@ No attributes available.
<dim>4</dim>
</port>
<port id="1">
<dim>3</dim> < !-- [1, 2, 3] will be promoted to [1, 1, 2, 3] -->
<dim>3</dim> <!-- [1, 2, 3] will be promoted to [1, 1, 2, 3] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Transpose
.. meta::
:description: Learn about Transpose-1 - a data movement operation, which can be
:description: Learn about Transpose-1 - a data movement operation, which can be
performed on two required input tensors.
**Versioned name**: *Transpose-1*
@ -53,7 +53,7 @@ Transpose
<dim>4</dim>
</port>
<port id="1">
<dim>3</dim> < !-- [2, 0, 1] -->
<dim>3</dim> <!-- [2, 0, 1] -->
</port>
</input>
<output>
@ -79,7 +79,7 @@ Transpose
<dim>4</dim>
</port>
<port id="1">
<dim>0</dim> < !-- input_order is an empty 1D tensor -->
<dim>0</dim> <!-- input_order is an empty 1D tensor -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ VariadicSplit
.. meta::
:description: Learn about VariadicSplit-1 - a data movement operation, which can be
:description: Learn about VariadicSplit-1 - a data movement operation, which can be
performed on three required input tensors.
**Versioned name**: *VariadicSplit-1*
@ -20,7 +20,7 @@ VariadicSplit
The i-th output tensor shape is equal to the input tensor `data` shape, except for dimension along `axis` which is ``split_lengths[i]``.
.. math::
shape\_output\_tensor = [data.shape[0], data.shape[1], \dotsc , split\_lengths[i], \dotsc , data.shape[D-1]]
Where D is the rank of input tensor `data`. The sum of elements in ``split_lengths`` must match ``data.shape[axis]``.
@ -49,16 +49,16 @@ Where D is the rank of input tensor `data`. The sum of elements in ``split_lengt
<layer id="1" type="VariadicSplit" ...>
<input>
<port id="0"> < !-- some data -->
<port id="0"> <!-- some data -->
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1"> < !-- axis: 0 -->
<port id="1"> <!-- axis: 0 -->
</port>
<port id="2">
<dim>3</dim> < !-- split_lengths: [1, 2, 3] -->
<dim>3</dim> <!-- split_lengths: [1, 2, 3] -->
</port>
</input>
<output>
@ -89,21 +89,21 @@ Where D is the rank of input tensor `data`. The sum of elements in ``split_lengt
<layer id="1" type="VariadicSplit" ...>
<input>
<port id="0"> < !-- some data -->
<port id="0"> <!-- some data -->
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1"> < !-- axis: 0 -->
<port id="1"> <!-- axis: 0 -->
</port>
<port id="2">
<dim>2</dim> < !-- split_lengths: [-1, 2] -->
<dim>2</dim> <!-- split_lengths: [-1, 2] -->
</port>
</input>
<output>
<port id="3">
<dim>4</dim> < !-- 4 = 6 - 2 -->
<dim>4</dim> <!-- 4 = 6 - 2 -->
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>

View File

@ -5,7 +5,7 @@ BatchNormInference
.. meta::
:description: Learn about BatchNormInference-5 - a normalization operation, which can be
:description: Learn about BatchNormInference-5 - a normalization operation, which can be
performed on five required input tensors.
**Versioned name**: *BatchNormInference-5*
@ -19,19 +19,19 @@ BatchNormInference
*BatchNormInference* performs the following operations on a given data batch input tensor ``data``:
* Normalizes each activation :math:`x^{(k)}` by the mean and variance.
.. math::
\hat{x}^{(k)}=\frac{x^{(k)} - E[x^{(k)}]}{\sqrt{Var(x^{(k)}) + \epsilon}}
where :math:`E[x^{(k)}]` and :math:`Var(x^{(k)})` are the mean and variance, calculated per channel axis of ``data`` input, and correspond to ``mean`` and ``variance`` inputs, respectively. Additionally, :math:`\epsilon` is a value added to the variance for numerical stability and corresponds to ``epsilon`` attribute.
* Performs linear transformation of each normalized activation based on ``gamma`` and ``beta`` input, representing the scaling factor and shift, respectively.
.. math::
\hat{y}^{(k)}=\gamma^{(k)}\hat{x}^{(k)} + \beta^{(k)}
where :math:`\gamma^{(k)}` and :math:`\beta^{(k)}` are learnable parameters, calculated per channel axis, and correspond to ``gamma`` and ``beta`` inputs.
**Mathematical Formulation**
@ -41,46 +41,46 @@ Let ``x`` be a *d*-dimensional input, :math:`x=(x_{1}\dotsc x_{d})`. Since norma
For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m values. *BatchNormInference* performs Batch Normalization algorithm as follows:
* **Input**: Values of :math:`x` over a mini-batch:
.. math::
\mathcal{B} = {x_{1...m}}
* **Parameters to learn**: :math:`\gamma, \beta`
* **Output**:
.. math::
{o_{i} = BN_{\gamma, \beta} ( b_{i} )}
* **Mini-batch mean**:
.. math::
\mu_{\mathcal{B}} \leftarrow \frac{1}{m}\sum_{i=1}^{m}b_{i}
* **Mini-batch variance**:
.. math::
\sigma_{\mathcal{B}}^{2}\leftarrow \frac{1}{m}\sum_{i=1}^{m} ( b_{i} - \mu_{\mathcal{B}})^{2}
* **Normalize**:
.. math::
\hat{b_{i}} \leftarrow \frac{b_{i} - \mu_{\mathcal{B}}}{\sqrt{\sigma_{\mathcal{B}}^{2} + \epsilon }}
* **Scale and shift**:
.. math::
o_{i} \leftarrow \gamma\hat{b_{i}} + \beta = BN_{\gamma ,\beta } ( b_{i} )
**Attributes**:
* *epsilon*
* **Description**: *epsilon* is a constant added to the variance for numerical stability.
* **Range of values**: a floating-point number greater than or equal to zero
* **Type**: ``float``
@ -104,28 +104,28 @@ For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m valu
**Examples**
Example: 2D input tensor ``data``
Example: 2D input tensor ``data``
.. code-block:: xml
:force:
<layer ... type="BatchNormInference" ...>
<data epsilon="9.99e-06" />
<input>
<port id="0"> < !-- input -->
<port id="0"> <!-- input -->
<dim>10</dim>
<dim>128</dim>
</port>
<port id="1"> < !-- gamma -->
<port id="1"> <!-- gamma -->
<dim>128</dim>
</port>
<port id="2"> < !-- beta -->
<port id="2"> <!-- beta -->
<dim>128</dim>
</port>
<port id="3"> < !-- mean -->
<port id="3"> <!-- mean -->
<dim>128</dim>
</port>
<port id="4"> < !-- variance -->
<port id="4"> <!-- variance -->
<dim>128</dim>
</port>
</input>
@ -141,26 +141,26 @@ Example: 4D input tensor ``data``
.. code-block:: xml
:force:
<layer ... type="BatchNormInference" ...>
<data epsilon="9.99e-06" />
<input>
<port id="0"> < !-- input -->
<port id="0"> <!-- input -->
<dim>1</dim>
<dim>3</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1"> < !-- gamma -->
<port id="1"> <!-- gamma -->
<dim>3</dim>
</port>
<port id="2"> < !-- beta -->
<port id="2"> <!-- beta -->
<dim>3</dim>
</port>
<port id="3"> < !-- mean -->
<port id="3"> <!-- mean -->
<dim>3</dim>
</port>
<port id="4"> < !-- variance -->
<port id="4"> <!-- variance -->
<dim>3</dim>
</port>
</input>

View File

@ -5,7 +5,7 @@ BatchNormInference
.. meta::
:description: Learn about BatchNormInference-5 - a normalization operation, which can be
:description: Learn about BatchNormInference-5 - a normalization operation, which can be
performed on five required input tensors.
**Versioned name**: *BatchNormInference-5*
@ -21,17 +21,17 @@ BatchNormInference
* Normalizes each activation :math:`x^{(k)}` by the mean and variance.
.. math::
\hat{x}^{(k)}=\frac{x^{(k)} - E[x^{(k)}]}{\sqrt{Var(x^{(k)}) + \epsilon}}
where :math:`E[x^{(k)}]` and :math:`Var(x^{(k)})` are the mean and variance, calculated per channel axis of ``data`` input, and correspond to ``mean`` and ``variance`` inputs, respectively. Additionally, :math:`\epsilon` is a value added to the variance for numerical stability and corresponds to ``epsilon`` attribute.
* Performs linear transformation of each normalized activation based on ``gamma`` and ``beta`` input, representing the scaling factor and shift, respectively.
.. math::
\hat{y}^{(k)}=\gamma^{(k)}\hat{x}^{(k)} + \beta^{(k)}
where :math:`\gamma^{(k)}` and :math:`\beta^{(k)}` are learnable parameters, calculated per channel axis, and correspond to ``gamma`` and ``beta`` inputs.
**Mathematical Formulation**
@ -41,47 +41,47 @@ Let ``x`` be a *d*-dimensional input, :math:`x=(x_{1}\dotsc x_{d})`. Since norma
For a particular activation, consider a mini-batch :math:`\mathcal{B}` of m values. *BatchNormInference* performs Batch Normalization algorithm as follows:
* **Input**: Values of :math:`x` over a mini-batch:
.. math::
\mathcal{B} = {x_{1...m}}
* **Parameters to learn**: :math:`\gamma, \beta`
* **Output**:
.. math::
{o_{i} = BN_{\gamma, \beta} ( b_{i} )}
* **Mini-batch mean**:
.. math::
\mu_{\mathcal{B}} \leftarrow \frac{1}{m}\sum_{i=1}^{m}b_{i}
* **Mini-batch variance**:
.. math::
\sigma_{\mathcal{B}}^{2}\leftarrow \frac{1}{m}\sum_{i=1}^{m} ( b_{i} - \mu_{\mathcal{B}})^{2}
* **Normalize**:
.. math::
\hat{b_{i}} \leftarrow \frac{b_{i} - \mu_{\mathcal{B}}}{\sqrt{\sigma_{\mathcal{B}}^{2} + \epsilon }}
* **Scale and shift**:
.. math::
o_{i} \leftarrow \gamma\hat{b_{i}} + \beta = BN_{\gamma ,\beta } ( b_{i} )
**Attributes**:
* *epsilon*
* **Description**: *epsilon* is a constant added to the variance for numerical stability.
* **Range of values**: a floating-point number greater than or equal to zero
* **Type**: ``float``
@ -109,24 +109,24 @@ Example: 2D input tensor ``data``
.. code-block:: xml
:force:
<layer ... type="BatchNormInference" ...>
<data epsilon="9.99e-06" />
<input>
<port id="0"> < !-- input -->
<port id="0"> <!-- input -->
<dim>10</dim>
<dim>128</dim>
</port>
<port id="1"> < !-- gamma -->
<port id="1"> <!-- gamma -->
<dim>128</dim>
</port>
<port id="2"> < !-- beta -->
<port id="2"> <!-- beta -->
<dim>128</dim>
</port>
<port id="3"> < !-- mean -->
<port id="3"> <!-- mean -->
<dim>128</dim>
</port>
<port id="4"> < !-- variance -->
<port id="4"> <!-- variance -->
<dim>128</dim>
</port>
</input>
@ -142,26 +142,26 @@ Example: 4D input tensor ``data``
.. code-block:: xml
:force:
<layer ... type="BatchNormInference" ...>
<data epsilon="9.99e-06" />
<input>
<port id="0"> < !-- input -->
<port id="0"> <!-- input -->
<dim>1</dim>
<dim>3</dim>
<dim>224</dim>
<dim>224</dim>
</port>
<port id="1"> < !-- gamma -->
<port id="1"> <!-- gamma -->
<dim>3</dim>
</port>
<port id="2"> < !-- beta -->
<port id="2"> <!-- beta -->
<dim>3</dim>
</port>
<port id="3"> < !-- mean -->
<port id="3"> <!-- mean -->
<dim>3</dim>
</port>
<port id="4"> < !-- variance -->
<port id="4"> <!-- variance -->
<dim>3</dim>
</port>
</input>

View File

@ -5,7 +5,7 @@ LRN
.. meta::
:description: Learn about LRN-1 - a normalization operation, which can be
:description: Learn about LRN-1 - a normalization operation, which can be
performed on two required input tensors.
**Versioned name**: *LRN-1*
@ -105,7 +105,7 @@ Example for 4D ``data`` input tensor and ``axes = [2, 3]``:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent normalization for each pixel along channels -->
<dim>1</dim> <!-- value is [1] that means independent normalization for each pixel along channels -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ MVN
.. meta::
:description: Learn about MVN-6 - a normalization operation, which can be
:description: Learn about MVN-6 - a normalization operation, which can be
performed on two required input tensors.
**Versioned name**: *MVN-6*
@ -100,7 +100,7 @@ If *normalize_variance* is set to ``true``, the output blob is divided by varian
<dim>24</dim>
</port>
<port id="1">
<dim>3</dim> < !-- value of [0,2,3] means independent normalization per channels -->
<dim>3</dim> <!-- value of [0,2,3] means independent normalization per channels -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ NormalizeL2
.. meta::
:description: Learn about MVN-1 - a normalization operation, which can be
:description: Learn about MVN-1 - a normalization operation, which can be
performed on two required input tensors.
**Versioned name**: *NormalizeL2-1*
@ -79,7 +79,7 @@ Example: Normalization over channel dimension for ``NCHW`` layout
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- axes list [1] means normalization over channel dimension -->
<dim>1</dim> <!-- axes list [1] means normalization over channel dimension -->
</port>
</input>
<output>
@ -108,7 +108,7 @@ Example: Normalization over channel and spatial dimensions for ``NCHW`` layout
<dim>24</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes list [1, 2, 3] means normalization over channel and spatial dimensions -->
<dim>3</dim> <!-- axes list [1, 2, 3] means normalization over channel and spatial dimensions -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceL1
.. meta::
:description: Learn about ReduceL1-4 - a reduction operation, which can be
:description: Learn about ReduceL1-4 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceL1-4*
@ -68,7 +68,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -96,7 +96,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -122,7 +122,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -149,7 +149,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>
@ -160,4 +160,4 @@ Particular cases:
</port>
</output>
</layer>

View File

@ -5,7 +5,7 @@ ReduceL2
.. meta::
:description: Learn about ReduceL2-4 - a reduction operation, which can be
:description: Learn about ReduceL2-4 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceL2-4*
@ -68,7 +68,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -95,7 +95,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -120,7 +120,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -146,7 +146,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceLogicalAnd
.. meta::
:description: Learn about ReduceLogicalAnd-1 - a reduction operation, which can be
:description: Learn about ReduceLogicalAnd-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceLogicalAnd-1*
@ -70,7 +70,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -97,7 +97,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -122,7 +122,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -148,7 +148,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceLogicalOr
.. meta::
:description: Learn about ReduceLogicalOr-1 - a reduction operation, which can be
:description: Learn about ReduceLogicalOr-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceLogicalOr-1*
@ -70,7 +70,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -97,7 +97,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -121,7 +121,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -147,7 +147,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceMax
.. meta::
:description: Learn about ReduceMax-1 - a reduction operation, which can be
:description: Learn about ReduceMax-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceMax-1*
@ -72,7 +72,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -99,7 +99,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -124,7 +124,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -150,7 +150,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceMean
.. meta::
:description: Learn about ReduceMean-1 - a reduction operation, which can be
:description: Learn about ReduceMean-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceMean-1*
@ -70,7 +70,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -97,7 +97,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -122,7 +122,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -147,7 +147,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceMin
.. meta::
:description: Learn about ReduceMin-1 - a reduction operation, which can be
:description: Learn about ReduceMin-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceMin-1*
@ -72,7 +72,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -99,7 +99,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -124,7 +124,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -150,7 +150,7 @@ Reducing empty tensor results in an undefined behavior.
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceProd
.. meta::
:description: Learn about ReduceProd-1 - a reduction operation, which can be
:description: Learn about ReduceProd-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceProd-1*
@ -70,7 +70,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -97,7 +97,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -122,7 +122,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -148,7 +148,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ReduceSum
.. meta::
:description: Learn about ReduceSum-1 - a reduction operation, which can be
:description: Learn about ReduceSum-1 - a reduction operation, which can be
performed on two required input tensors.
**Versioned name**: *ReduceSum-1*
@ -70,7 +70,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -97,7 +97,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> < !-- value is [2, 3] that means independent reduction in each channel and batch -->
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
@ -122,7 +122,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [1] that means independent reduction in each channel and spatial dimensions -->
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
@ -148,7 +148,7 @@ Particular cases:
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> < !-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
<dim>1</dim> <!-- value is [-2] that means independent reduction in each channel, batch and second spatial dimension -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ CTCGreedyDecoderSeqLen
.. meta::
:description: Learn about CTCGreedyDecoderSeqLen-6 - a sequence processing
:description: Learn about CTCGreedyDecoderSeqLen-6 - a sequence processing
operation, which can be performed on two required input tensors.
**Versioned name**: *CTCGreedyDecoderSeqLen-6*
@ -77,7 +77,7 @@ The main difference between :doc:`CTCGreedyDecoder <openvino_docs_ops_sequence_C
.. code-block:: xml
:force:
<layer ... type="CTCGreedyDecoderSeqLen" version="opset6">
<data merge_repeated="true" classes_index_type="i64" sequence_length_type="i64"/>
<input>
@ -89,7 +89,7 @@ The main difference between :doc:`CTCGreedyDecoder <openvino_docs_ops_sequence_C
<port id="1">
<dim>8</dim>
</port>
<port id="2"/> < !-- blank_index = 120 -->
<port id="2"/> <!-- blank_index = 120 -->
</input>
<output>
<port id="0" precision="I64">

View File

@ -5,7 +5,7 @@ CTCLoss
.. meta::
:description: Learn about CTCLoss-4 - a sequence processing operation, which
:description: Learn about CTCLoss-4 - a sequence processing operation, which
can be performed on four required and one optional input tensor.
**Versioned name**: *CTCLoss-4*
@ -29,19 +29,19 @@ Otherwise, the operation behaviour is undefined.
1. Compute probability of ``j``-th character at time step ``t`` for ``i``-th input sequence from ``logits`` using softmax formula:
.. math::
p_{i,t,j} = \frac{\exp(logits[i,t,j])}{\sum^{K}_{k=0}{\exp(logits[i,t,k])}}
2. For a given ``i``-th target from ``labels[i,:]`` find all aligned paths. A path ``S = (c1,c2,...,cT)`` is aligned with a target ``G=(g1,g2,...,gT)`` if both chains are equal after decoding. The decoding extracts substring of length ``label_length[i]`` from a target ``G``, merges repeated characters in ``G`` in case *preprocess_collapse_repeated* equal to true and finds unique elements in the order of character occurrence in case *unique* equal to true. The decoding merges repeated characters in ``S`` in case *ctc_merge_repeated* equal to true and removes blank characters represented by ``blank_index``. By default, ``blank_index`` is equal to ``C-1``, where ``C`` is a number of classes including the blank. For example, in case default *ctc_merge_repeated*, *preprocess_collapse_repeated*, *unique* and ``blank_index`` a target sequence ``G=(0,3,2,2,2,2,2,4,3)`` of a length ``label_length[i]=4`` is processed to ``(0,3,2,2)`` and a path ``S=(0,0,4,3,2,2,4,2,4)`` of a length ``logit_length[i]=9`` is also processed to ``(0,3,2,2)``, where ``C=5``. There exist other paths that are also aligned with ``G``, for instance, ``0,4,3,3,2,4,2,2,2``. Paths checked for alignment with a target ``label[:,i]`` must be of length ``logit_length[i] = L_i``. Compute probabilities of these aligned paths (alignments) as follows:
.. math::
p(S) = \prod_{t=1}^{L_i} p_{i,t,ct}
3. Finally, compute negative log of summed up probabilities of all found alignments:
.. math::
CTCLoss = - \ln \sum_{S} p(S)
**Note 1**: This calculation scheme does not provide steps for optimal implementation and primarily serves for better explanation.
@ -50,7 +50,7 @@ Otherwise, the operation behaviour is undefined.
Having log-probabilities for aligned paths, log of summed up probabilities for these paths can be computed as follows:
.. math::
\ln(a + b) = \ln(a) + \ln(1 + \exp(\ln(b) - \ln(a)))
**Attributes**
@ -100,7 +100,7 @@ Having log-probabilities for aligned paths, log of summed up probabilities for t
.. code-block:: xml
:force:
<layer ... type="CTCLoss" ...>
<input>
<port id="0">
@ -118,7 +118,7 @@ Having log-probabilities for aligned paths, log of summed up probabilities for t
<port id="3">
<dim>8</dim>
</port>
<port id="4"> < !-- blank_index value is: 120 -->
<port id="4"> <!-- blank_index value is: 120 -->
</input>
<output>
<port id="0">

View File

@ -5,7 +5,7 @@ OneHot
.. meta::
:description: Learn about OneHot-1 - a sequence processing operation, which
:description: Learn about OneHot-1 - a sequence processing operation, which
can be performed on four required input tensors.
**Versioned name**: *OneHot-1*
@ -64,18 +64,18 @@ The types of input scalars ``on_value`` and ``off_value`` should match and be eq
<layer ... type="OneHot" ...>
<data axis="-1"/>
<input>
<port id="0"> < !-- indices value: [0, 3, 1, 2] -->
<port id="0"> <!-- indices value: [0, 3, 1, 2] -->
<dim>4</dim>
</port>
<port id="1"> < !-- depth value: 3 -->
<port id="1"> <!-- depth value: 3 -->
</port>
<port id="2"> < !-- on_value 1 -->
<port id="2"> <!-- on_value 1 -->
</port>
<port id="3"> < !-- off_value 2 -->
<port id="3"> <!-- off_value 2 -->
</port>
</input>
<output>
<port id="0"> < !-- output value # [[1, 2, 2], [2, 2, 2], [2, 1, 2], [2, 2, 1]] -->
<port id="0"> <!-- output value # [[1, 2, 2], [2, 2, 2], [2, 1, 2], [2, 2, 1]] -->
<dim>4</dim>
<dim>3</dim>
</port>
@ -90,20 +90,20 @@ The types of input scalars ``on_value`` and ``off_value`` should match and be eq
<layer ... type="OneHot" ...>
<data axis="1"/>
<input>
<port id="0"> < !-- indices value: [[0, 3, 1], [1, 2, 4]] -->
<port id="0"> <!-- indices value: [[0, 3, 1], [1, 2, 4]] -->
<dim>2</dim>
<dim>3</dim>
</port>
<port id="1"> < !-- depth value: 3 -->
<port id="1"> <!-- depth value: 3 -->
</port>
<port id="2"> < !-- on_value 1 -->
<port id="2"> <!-- on_value 1 -->
</port>
<port id="3"> < !-- off_value 0 -->
<port id="3"> <!-- off_value 0 -->
</port>
</input>
<output>
<port id="0"> < !-- output value: [[[1, 0, 0], [0, 0, 1], [0, 0, 0]], -->
<dim>2</dim> < !-- [[0, 0, 0], [1, 0, 0], [0, 1, 0]]] -->
<port id="0"> <!-- output value: [[[1, 0, 0], [0, 0, 1], [0, 0, 0]], -->
<dim>2</dim> <!-- [[0, 0, 0], [1, 0, 0], [0, 1, 0]]] -->
<dim>3</dim>
<dim>3</dim>
</port>

View File

@ -5,7 +5,7 @@ Reshape
.. meta::
:description: Learn about Reshape-1 - a shape manipulation operation, which
:description: Learn about Reshape-1 - a shape manipulation operation, which
can be performed on two required input tensors.
**Versioned name**: *Reshape-1*
@ -65,7 +65,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the
<dim>0</dim>
</port>
<port id="1">
<dim>2</dim> < !--The tensor contains 2 elements: 0, 4 -->
<dim>2</dim> <!--The tensor contains 2 elements: 0, 4 -->
</port>
</input>
<output>
@ -92,7 +92,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the
<dim>24</dim>
</port>
<port id="1">
<dim>3</dim> < !--The tensor contains 3 elements: 0, -1, 4 -->
<dim>3</dim> <!--The tensor contains 3 elements: 0, -1, 4 -->
</port>
</input>
<output>
@ -119,7 +119,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the
<dim>3</dim>
</port>
<port id="1">
<dim>4</dim> < !--The tensor contains 4 elements: 0, 0, 1, -1 -->
<dim>4</dim> <!--The tensor contains 4 elements: 0, 0, 1, -1 -->
</port>
</input>
<output>
@ -147,7 +147,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the
<dim>1</dim>
</port>
<port id="1">
<dim>2</dim> < !--The tensor contains 2 elements: -1, 0 -->
<dim>2</dim> <!--The tensor contains 2 elements: -1, 0 -->
</port>
</input>
<output>
@ -173,7 +173,7 @@ If ``special_zero`` is set to ``true`` index of ``0`` cannot be larger than the
<dim>1</dim>
</port>
<port id="1">
<dim>2</dim> < !--The tensor contains 2 elements: 0, -1 -->
<dim>2</dim> <!--The tensor contains 2 elements: 0, -1 -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ ShapeOf
.. meta::
:description: Learn about ShapeOf-1 - a shape manipulation operation, which
:description: Learn about ShapeOf-1 - a shape manipulation operation, which
can be performed on an arbitrary input tensor.
**Versioned name**: *ShapeOf-1*
@ -39,7 +39,7 @@ ShapeOf
</port>
</input>
<output>
<port id="1"> < !-- output value is: [2,3,224,224]-->
<port id="1"> <!-- output value is: [2,3,224,224]-->
<dim>4</dim>
</port>
</output>

View File

@ -5,7 +5,7 @@ ShapeOf
.. meta::
:description: Learn about ShapeOf-3 - a shape manipulation operation, which
:description: Learn about ShapeOf-3 - a shape manipulation operation, which
can be performed on an arbitrary input tensor.
**Versioned name**: *ShapeOf-3*
@ -54,7 +54,7 @@ ShapeOf
</port>
</input>
<output>
<port id="1"> < !-- output value is: [2,3,224,224]-->
<port id="1"> <!-- output value is: [2,3,224,224]-->
<dim>4</dim>
</port>
</output>

View File

@ -5,7 +5,7 @@ Squeeze
.. meta::
:description: Learn about Squeeze-1 - a shape manipulation operation, which
:description: Learn about Squeeze-1 - a shape manipulation operation, which
can be performed on one required and one optional input tensor.
**Versioned name**: *Squeeze-1*
@ -55,7 +55,7 @@ Squeeze
</input>
<input>
<port id="1">
<dim>2</dim> < !-- value [0, 2] -->
<dim>2</dim> <!-- value [0, 2] -->
</port>
</input>
<output>
@ -79,7 +79,7 @@ Squeeze
</input>
<input>
<port id="1">
<dim>1</dim> < !-- value is [0] -->
<dim>1</dim> <!-- value is [0] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ Unsqueeze
.. meta::
:description: Learn about Unsqueeze-1 - a shape manipulation operation, which
:description: Learn about Unsqueeze-1 - a shape manipulation operation, which
can be performed on two required input tensors.
**Versioned name**: *Unsqueeze-1*
@ -48,7 +48,7 @@ Unsqueeze
</input>
<input>
<port id="1">
<dim>2</dim> < !-- value is [0, 3] -->
<dim>2</dim> <!-- value is [0, 3] -->
</port>
</input>
<output>
@ -74,7 +74,7 @@ Unsqueeze
</input>
<input>
<port id="1">
<dim>1</dim> < !-- value is [0] -->
<dim>1</dim> <!-- value is [0] -->
</port>
</input>
<output>

View File

@ -5,7 +5,7 @@ DFT
.. meta::
:description: Learn about DFT-7 - a signal processing operation, which can be
:description: Learn about DFT-7 - a signal processing operation, which can be
performed on two required and one optional input tensor.
**Versioned name**: *DFT-7*
@ -23,14 +23,14 @@ No attributes available.
* **1**: ``data`` - Input tensor of type *T* with data for the DFT transformation. Type of elements is any supported floating-point type. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.**
* **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where DFT is applied, and ``axes`` is any unordered list of indices of different dimensions of input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.**
.. note::
.. note::
The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and input_shape[-1] == 2 and (rank(data) - 1) not in axes and (-1) not in axes``.
* **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then DFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > input_shape[: r - 1][axes[i]]``, then input data are zero-padded with respect to the axis ``axes[i]`` at the end. Finally, ``signal_size[i] < input_shape[: r - 1][axes[i]]``, then input data are trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optional, with default value ```[input_shape[: r - 1][a] for a in axes]```.
.. note::
.. note::
If the input ``signal_size`` is specified, the size of ``signal_size`` must be the same as the size of ``axes``.
**Outputs**
@ -52,7 +52,7 @@ Let ``D`` be an input tensor ``A``, taking into account the ``signal_size``, and
Next, put
.. math::
X[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1}]=D[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},0]+iD[j_0,\dots,j_{k-1},j_k,\dots,j_{k+r-1},1]
for all indices ``j_0,...,j_{k+r-1}``, where ``i`` is an imaginary unit, that is ``X`` is a complex tensor.
@ -60,17 +60,17 @@ for all indices ``j_0,...,j_{k+r-1}``, where ``i`` is an imaginary unit, that is
Then the discrete Fourier transform is the tensor :math:`Y` of the same shape as the tensor :math:`X`, such that
.. math::
Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}]=\sum\limits_{j_0=0}^{S_0-1}\cdots\sum\limits_{j_{r-1}=0}^{S_{r-1}-1}X[n_0,\dots,n_{k-1},j_0,\dots,j_{r-1}]\exp\left(-2\pi i\sum\limits_{q=0}^{r-1}\frac{m_qj_q}{S_q}\right)
for all indices ``n_0,...,n_{k-1}``, ``m_0,...,m_{r-1}``, and the result of the operation is the real tensor ``Z`` with the shape ``[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]`` and such that
.. math::
Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 0]=Re Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}],
.. math::
Z[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}, 1]=Im Y[n_0,\dots,n_{k-1},m_0,\dots,m_{r-1}].
Calculations for the generic case of axes and signal sizes are similar.
@ -81,7 +81,7 @@ There is no ``signal_size`` input (4D input tensor):
.. code-block:: xml
:force:
<layer ... type="DFT" ... >
<input>
<port id="0">
@ -91,7 +91,7 @@ There is no ``signal_size`` input (4D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [1, 2] -->
<dim>2</dim> <!-- axes input contains [1, 2] -->
</port>
<output>
<port id="2">
@ -107,7 +107,7 @@ There is no ``signal_size`` input (3D input tensor):
.. code-block:: xml
:force:
<layer ... type="DFT" ... >
<input>
<port id="0">
@ -116,7 +116,7 @@ There is no ``signal_size`` input (3D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [0, 1] -->
<dim>2</dim> <!-- axes input contains [0, 1] -->
</port>
<output>
<port id="2">
@ -131,7 +131,7 @@ There is ``signal_size`` input (4D input tensor):
.. code-block:: xml
:force:
<layer ... type="DFT" ... >
<input>
<port id="0">
@ -141,10 +141,10 @@ There is ``signal_size`` input (4D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [1, 2] -->
<dim>2</dim> <!-- axes input contains [1, 2] -->
</port>
<port id="2">
<dim>2</dim> < !-- signal_size input contains [512, 100] -->
<dim>2</dim> <!-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
@ -160,7 +160,7 @@ There is ``signal_size`` input (3D input tensor):
.. code-block:: xml
:force:
<layer ... type="DFT" ... >
<input>
<port id="0">
@ -169,10 +169,10 @@ There is ``signal_size`` input (3D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [0, 1] -->
<dim>2</dim> <!-- axes input contains [0, 1] -->
</port>
<port id="2">
<dim>2</dim> < !-- signal_size input contains [512, 100] -->
<dim>2</dim> <!-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
@ -187,7 +187,7 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
.. code-block:: xml
:force:
<layer ... type="DFT" ... >
<input>
<port id="0">
@ -198,10 +198,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 1, 2] -->
<dim>3</dim> <!-- axes input contains [3, 1, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [170, -1, 1024] -->
<dim>3</dim> <!-- signal_size input contains [170, -1, 1024] -->
</port>
<output>
<port id="3">
@ -218,7 +218,7 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
.. code-block:: xml
:force:
<layer ... type="DFT" ... >
<input>
<port id="0">
@ -229,10 +229,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 0, 2] -->
<dim>3</dim> <!-- axes input contains [3, 0, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [258, -1, 2056] -->
<dim>3</dim> <!-- signal_size input contains [258, -1, 2056] -->
</port>
<output>
<port id="3">

View File

@ -5,7 +5,7 @@ Inverse Discrete Fourier Transformation (IDFT)
.. meta::
:description: Learn about IDFT-7 - a signal processing operation, which can be
:description: Learn about IDFT-7 - a signal processing operation, which can be
performed on two required and one optional input tensor.
**Versioned name**: *IDFT-7*
@ -22,16 +22,16 @@ No attributes available.
* **1**: ``data`` - Input tensor of type *T* with data for the IDFT transformation. Type of elements is any supported floating-point type. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.**
* **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where IDFT is applied, and ``axes`` is any unordered list of indices of different dimensions of input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.**
*
*
.. note::
The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and input_shape[-1] == 2 and (rank(data) - 1) not in axes and (-1) not in axes``.
* **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then IDFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > input_shape[: r - 1][axes[i]]``, then input data are zero-padded with respect to the axis ``axes[i]`` at the end. Finally, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, then input data are trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < input_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optional, with default value ``[input_shape[: r - 1][a] for a in axes]``.
*
*
.. note::
If the input ``signal_size`` is specified, then the size of ``signal_size`` must be the same as the size of ``axes``.
**Outputs**
@ -52,7 +52,7 @@ For simplicity, assume that an input tensor ``A`` has the shape ``[B_0, ..., B_{
Let ``D`` be an input tensor ``A``, taking into account the ``signal_size``, and, hence, ``D`` has the shape ``[B_0, ..., B_{k-1}, S_0, ..., S_{r-1}, 2]``.
Next, put
Next, put
.. math::
@ -94,7 +94,7 @@ There is no ``signal_size`` input (4D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [1, 2] -->
<dim>2</dim> <!-- [1, 2] -->
</port>
<output>
<port id="2">
@ -120,7 +120,7 @@ There is no ``signal_size`` input (3D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [0, 1] -->
<dim>2</dim> <!-- [0, 1] -->
</port>
<output>
<port id="2">
@ -147,10 +147,10 @@ There is ``signal_size`` input (4D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [1, 2] -->
<dim>2</dim> <!-- [1, 2] -->
</port>
<port id="2">
<dim>2</dim> < !-- [512, 100] -->
<dim>2</dim> <!-- [512, 100] -->
</port>
<output>
<port id="3">
@ -177,10 +177,10 @@ There is ``signal_size`` input (3D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [0, 1] -->
<dim>2</dim> <!-- [0, 1] -->
</port>
<port id="2">
<dim>2</dim> < !-- [512, 100] -->
<dim>2</dim> <!-- [512, 100] -->
</port>
<output>
<port id="3">
@ -208,10 +208,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 1, 2] -->
<dim>3</dim> <!-- axes input contains [3, 1, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [170, -1, 1024] -->
<dim>3</dim> <!-- signal_size input contains [170, -1, 1024] -->
</port>
<output>
<port id="3">
@ -241,10 +241,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 0, 2] -->
<dim>3</dim> <!-- axes input contains [3, 0, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [258, -1, 2056] -->
<dim>3</dim> <!-- signal_size input contains [258, -1, 2056] -->
</port>
<output>
<port id="3">

View File

@ -5,7 +5,7 @@ Inverse Discrete complex-to-real Fourier Transformation (IRDFT)
.. meta::
:description: Learn about IRDFT-9 - a signal processing operation, which can be
:description: Learn about IRDFT-9 - a signal processing operation, which can be
performed on two required and one optional input tensor.
**Versioned name**: *IRDFT-9*
@ -22,18 +22,18 @@ No attributes available.
* **1**: ``data`` - Input tensor of type *T* with data for the IRDFT transformation. The last dimension of the input tensor must be equal to 2, that is the input tensor shape must have the form ``[D_0, D_1, ..., D_{N-1}, 2]``, representing the real and imaginary components of complex numbers in ``[:, ..., :, 0]`` and in ``[:, ..., :, 1]`` correspondingly. **Required.**
* **2**: ``axes`` - 1D tensor of type *T_IND* specifying dimension indices where IRDFT is applied, and ``axes`` is any unordered list of indices of different dimensions of the input tensor, for example, ``[0, 4]``, ``[4, 0]``, ``[4, 2, 1]``, ``[1, 2, 3]``, ``[-3, 0, -2]``. These indices should be integers from ``-(r - 1)`` to ``(r - 2)`` inclusively, where ``r = rank(data)``. A negative axis ``a`` is interpreted as an axis ``r - 1 + a``. Other dimensions do not change. The order of elements in the ``axes`` attribute matters, and is mapped directly to elements in the third input ``signal_size``. **Required.**
*
*
.. note::
The following constraint must be satisfied: ``rank(data) >= len(axes) + 1 and (rank(data) - 1) not in axes and (-1) not in axes``.
* **3**: ``signal_size`` - 1D tensor of type *T_SIZE* describing signal size with respect to axes from the input ``axes``. If ``signal_size[i] == -1``, then IRDFT is calculated for full size of the axis ``axes[i]``. If ``signal_size[i] > data_shape[: r - 1][axes[i]]``, then input data is zero-padded with respect to the axis ``axes[i]`` at the end. Finally, if ``signal_size[i] < data_shape[: r - 1][axes[i]]``, then input data is trimmed with respect to the axis ``axes[i]``. More precisely, if ``signal_size[i] < data_shape[: r - 1][axes[i]]``, the slice ``0: signal_size[i]`` of the axis ``axes[i]`` is considered. Optionally, with default value ``[data_shape[: r - 1][a] for a in axes]``.
*
*
.. note::
If the input ``signal_size`` is specified, then the size of ``signal_size`` must be the same as the size of ``axes``.
@ -110,7 +110,7 @@ There is no ``signal_size`` input (4D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [1, 2] -->
<dim>2</dim> <!-- [1, 2] -->
</port>
<output>
<port id="2">
@ -135,7 +135,7 @@ There is no ``signal_size`` input (3D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [0, 1] -->
<dim>2</dim> <!-- [0, 1] -->
</port>
<output>
<port id="2">
@ -160,10 +160,10 @@ There is ``signal_size`` input (4D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [1, 2] -->
<dim>2</dim> <!-- [1, 2] -->
</port>
<port id="2">
<dim>2</dim> < !-- [512, 100] -->
<dim>2</dim> <!-- [512, 100] -->
</port>
<output>
<port id="3">
@ -189,10 +189,10 @@ There is ``signal_size`` input (3D input tensor):
<dim>2</dim>
</port>
<port id="1">
<dim>2</dim> < !-- [0, 1] -->
<dim>2</dim> <!-- [0, 1] -->
</port>
<port id="2">
<dim>2</dim> < !-- [512, 100] -->
<dim>2</dim> <!-- [512, 100] -->
</port>
<output>
<port id="3">
@ -219,10 +219,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 1, 2] -->
<dim>3</dim> <!-- axes input contains [3, 1, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [170, -1, 1024] -->
<dim>3</dim> <!-- signal_size input contains [170, -1, 1024] -->
</port>
<output>
<port id="3">
@ -250,10 +250,10 @@ There is ``signal_size`` input (5D input tensor, ``-1`` in ``signal_size``, unso
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 0, 2] -->
<dim>3</dim> <!-- axes input contains [3, 0, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [258, -1, 2056] -->
<dim>3</dim> <!-- signal_size input contains [258, -1, 2056] -->
</port>
<output>
<port id="3">

View File

@ -5,7 +5,7 @@ Discrete Fourier Transformation for real-valued input (RDFT)
.. meta::
:description: Learn about RDFT-9 - a signal processing operation, which can be
:description: Learn about RDFT-9 - a signal processing operation, which can be
performed on two required and one optional input tensor.
**Versioned name**: *RDFT-9*
@ -85,7 +85,7 @@ There is no ``signal_size`` input (3D input tensor):
<dim>320</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [1, 2] -->
<dim>2</dim> <!-- axes input contains [1, 2] -->
</port>
<output>
<port id="2">
@ -110,7 +110,7 @@ There is no ``signal_size`` input (2D input tensor):
<dim>320</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [0, 1] -->
<dim>2</dim> <!-- axes input contains [0, 1] -->
</port>
<output>
<port id="2">
@ -136,10 +136,10 @@ There is ``signal_size`` input (3D input tensor):
<dim>320</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [1, 2] -->
<dim>2</dim> <!-- axes input contains [1, 2] -->
</port>
<port id="2">
<dim>2</dim> < !-- signal_size input contains [512, 100] -->
<dim>2</dim> <!-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
@ -163,10 +163,10 @@ There is ``signal_size`` input (2D input tensor):
<dim>320</dim>
</port>
<port id="1">
<dim>2</dim> < !-- axes input contains [0, 1] -->
<dim>2</dim> <!-- axes input contains [0, 1] -->
</port>
<port id="2">
<dim>2</dim> < !-- signal_size input contains [512, 100] -->
<dim>2</dim> <!-- signal_size input contains [512, 100] -->
</port>
<output>
<port id="3">
@ -192,10 +192,10 @@ There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unso
<dim>320</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 1, 2] -->
<dim>3</dim> <!-- axes input contains [3, 1, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [170, -1, 1024] -->
<dim>3</dim> <!-- signal_size input contains [170, -1, 1024] -->
</port>
<output>
<port id="3">
@ -222,10 +222,10 @@ There is ``signal_size`` input (4D input tensor, ``-1`` in ``signal_size``, unso
<dim>320</dim>
</port>
<port id="1">
<dim>3</dim> < !-- axes input contains [3, 0, 2] -->
<dim>3</dim> <!-- axes input contains [3, 0, 2] -->
</port>
<port id="2">
<dim>3</dim> < !-- signal_size input contains [258, -1, 2056] -->
<dim>3</dim> <!-- signal_size input contains [258, -1, 2056] -->
</port>
<output>
<port id="3">

View File

@ -5,8 +5,8 @@ MatrixNonMaxSuppression
.. meta::
:description: Learn about MatrixNonMaxSuppression-8 - a sorting and
maximization operation, which can be performed on two required
:description: Learn about MatrixNonMaxSuppression-8 - a sorting and
maximization operation, which can be performed on two required
input tensors.
**Versioned name**: *MatrixNonMaxSuppression-8*
@ -176,7 +176,7 @@ When there is no box selected, ``selected_num`` is filled with ``0``. ``selected
</input>
<output>
<port id="5" precision="FP32">
<dim>-1</dim> < !-- "-1" means a undefined dimension calculated during the model inference -->
<dim>-1</dim> <!-- "-1" means a undefined dimension calculated during the model inference -->
<dim>6</dim>
</port>
<port id="6" precision="I64">

View File

@ -5,8 +5,8 @@ MulticlassNonMaxSuppression
.. meta::
:description: Learn about MulticlassNonMaxSuppression-8 - a sorting and
maximization operation, which can be performed on two required
:description: Learn about MulticlassNonMaxSuppression-8 - a sorting and
maximization operation, which can be performed on two required
input tensors.
**Versioned name**: *MulticlassNonMaxSuppression-8*
@ -168,7 +168,7 @@ When there is no box selected, ``selected_num`` is filled with ``0``. ``selected
</input>
<output>
<port id="5" precision="FP32">
<dim>-1</dim> < !-- "-1" means a undefined dimension calculated during the model inference -->
<dim>-1</dim> <!-- "-1" means a undefined dimension calculated during the model inference -->
<dim>6</dim>
</port>
<port id="6" precision="I64">

View File

@ -2,8 +2,8 @@
.. meta::
:description: Learn about MulticlassNonMaxSuppression-8 - a sorting and
maximization operation, which can be performed on two or three
:description: Learn about MulticlassNonMaxSuppression-8 - a sorting and
maximization operation, which can be performed on two or three
required input tensors.
**Versioned name**: *MulticlassNonMaxSuppression-9*
@ -174,7 +174,7 @@ When there is no box selected, ``selected_num`` is filled with ``0``. ``selected
</input>
<output>
<port id="5" precision="FP32">
<dim>-1</dim> < !-- "-1" means a undefined dimension calculated during the model inference -->
<dim>-1</dim> <!-- "-1" means a undefined dimension calculated during the model inference -->
<dim>6</dim>
</port>
<port id="6" precision="I64">
@ -211,7 +211,7 @@ Another possible example with 3 inputs could be like:
</input>
<output>
<port id="5" precision="FP32">
<dim>-1</dim> < !-- "-1" means a undefined dimension calculated during the model inference -->
<dim>-1</dim> <!-- "-1" means a undefined dimension calculated during the model inference -->
<dim>6</dim>
</port>
<port id="6" precision="I64">

View File

@ -131,11 +131,11 @@ Plugins that do not support dynamic output tensors produce ``selected_indices``
</input>
<output>
<port id="6" precision="I64">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
<port id="7" precision="FP32">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
<port id="8" precision="I64">

View File

@ -5,8 +5,8 @@ NonMaxSuppression
.. meta::
:description: Learn about NonMaxSuppression-4 - a sorting and maximization
operation, which can be performed on two required and three
:description: Learn about NonMaxSuppression-4 - a sorting and maximization
operation, which can be performed on two required and three
optional input tensors.
**Versioned name**: *NonMaxSuppression-4*
@ -108,7 +108,7 @@ The output tensor is filled with -1s for output tensor elements if the total num
</input>
<output>
<port id="5" precision="I64">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
</output>

View File

@ -5,8 +5,8 @@ NonMaxSuppression
.. meta::
:description: Learn about NonMaxSuppression-5 - a sorting and maximization
operation, which can be performed on two required and four
:description: Learn about NonMaxSuppression-5 - a sorting and maximization
operation, which can be performed on two required and four
optional input tensors.
**Versioned name**: *NonMaxSuppression-5*
@ -120,11 +120,11 @@ Plugins which do not support dynamic output tensors produce ``selected_indices``
</input>
<output>
<port id="5" precision="I64">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
<port id="6" precision="FP32">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
<port id="7" precision="I64">

View File

@ -5,8 +5,8 @@ NonMaxSuppression
.. meta::
:description: Learn about NonMaxSuppression-9 - a sorting and maximization
operation, which can be performed on two required and four
:description: Learn about NonMaxSuppression-9 - a sorting and maximization
operation, which can be performed on two required and four
optional input tensors.
**Versioned name**: *NonMaxSuppression-9*
@ -120,11 +120,11 @@ Plugins which do not support dynamic output tensors produce ``selected_indices``
</input>
<output>
<port id="6" precision="I64">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
<port id="7" precision="FP32">
<dim>150</dim> < !-- min(100, 10) * 3 * 5 -->
<dim>150</dim> <!-- min(100, 10) * 3 * 5 -->
<dim>3</dim>
</port>
<port id="8" precision="I64">

View File

@ -5,7 +5,7 @@ EmbeddingBagOffsetsSum
.. meta::
:description: Learn about EmbeddingBagOffsetsSum-3 - a sparse operation, which
:description: Learn about EmbeddingBagOffsetsSum-3 - a sparse operation, which
can be performed on three required and two optional input tensors.
**Versioned name**: *EmbeddingBagOffsetsSum-3*
@ -38,26 +38,26 @@ EmbeddingBagOffsetsSum
**Example**
.. code-block:: cpp
<layer ... type="EmbeddingBagOffsetsSum" ... >
<input>
<port id="0"> < !-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<port id="0"> <!-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<dim>5</dim>
<dim>2</dim>
</port>
<port id="1"> < !-- indices value is: [0, 2, 3, 4] -->
<port id="1"> <!-- indices value is: [0, 2, 3, 4] -->
<dim>4</dim>
</port>
<port id="2"> < !-- offsets value is: [0, 2, 2] - 3 "bags" containing [2,0,4-2] elements, second "bag" is empty -->
<port id="2"> <!-- offsets value is: [0, 2, 2] - 3 "bags" containing [2,0,4-2] elements, second "bag" is empty -->
<dim>3</dim>
</port>
<port id="3"/> < !-- default_index value is: 0 -->
<port id="4"/> < !-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] -->
<port id="3"/> <!-- default_index value is: 0 -->
<port id="4"/> <!-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] -->
<dim>4</dim>
</port>
</input>
<output>
<port id="5"> < !-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] -->
<port id="5"> <!-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] -->
<dim>3</dim>
<dim>2</dim>
</port>

View File

@ -5,7 +5,7 @@ EmbeddingBagPackedSum
.. meta::
:description: Learn about EmbeddingBagPackedSum-3 - a sparse operation, which
:description: Learn about EmbeddingBagPackedSum-3 - a sparse operation, which
can be performed on two required and one optional input tensor.
**Versioned name**: *EmbeddingBagPackedSum-3*
@ -36,24 +36,24 @@ EmbeddingBagPackedSum
**Example**
.. code-block:: cpp
<layer ... type="EmbeddingBagPackedSum" ... >
<input>
<port id="0"> < !-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<port id="0"> <!-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<dim>5</dim>
<dim>2</dim>
</port>
<port id="1"> < !-- indices value is: [[0, 2], [1, 2], [3, 4]] -->
<port id="1"> <!-- indices value is: [[0, 2], [1, 2], [3, 4]] -->
<dim>3</dim>
<dim>2</dim>
</port>
<port id="2"/> < !-- per_sample_weigths value is: [[0.5, 0.5], [0.5, 0.5], [0.5, 0.5]] -->
<port id="2"/> <!-- per_sample_weigths value is: [[0.5, 0.5], [0.5, 0.5], [0.5, 0.5]] -->
<dim>3</dim>
<dim>2</dim>
</port>
</input>
<output>
<port id="4"> < !-- output value is: [[-1.05, -1.2], [-1., -1.1], [-0.1, 0.4]] -->
<port id="4"> <!-- output value is: [[-1.05, -1.2], [-1., -1.1], [-0.1, 0.4]] -->
<dim>3</dim>
<dim>2</dim>
</port>

View File

@ -5,7 +5,7 @@ EmbeddingSegmentsSum
.. meta::
:description: Learn about EmbeddingSegmentsSum-3 - a sparse operation, which
:description: Learn about EmbeddingSegmentsSum-3 - a sparse operation, which
can be performed on four required and two optional input tensors.
**Versioned name**: *EmbeddingSegmentsSum-3*
@ -39,27 +39,27 @@ EmbeddingSegmentsSum
**Example**
.. code-block:: cpp
<layer ... type="EmbeddingSegmentsSum" ... >
<input>
<port id="0"> < !-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<port id="0"> <!-- emb_table value is: [[-0.2, -0.6], [-0.1, -0.4], [-1.9, -1.8], [-1., 1.5], [ 0.8, -0.7]] -->
<dim>5</dim>
<dim>2</dim>
</port>
<port id="1"> < !-- indices value is: [0, 2, 3, 4] -->
<port id="1"> <!-- indices value is: [0, 2, 3, 4] -->
<dim>4</dim>
</port>
<port id="2"/> < !-- segment_ids value is: [0, 0, 2, 2] - second segment is empty -->
<port id="2"/> <!-- segment_ids value is: [0, 0, 2, 2] - second segment is empty -->
<dim>4</dim>
</port>
<port id="3"/> < !-- num_segments value is: 3 -->
<port id="4"/> < !-- default_index value is: 0 -->
<port id="5"/> < !-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] -->
<port id="3"/> <!-- num_segments value is: 3 -->
<port id="4"/> <!-- default_index value is: 0 -->
<port id="5"/> <!-- per_sample_weigths value is: [0.5, 0.5, 0.5, 0.5] -->
<dim>4</dim>
</port>
</input>
<output>
<port id="6"> < !-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] -->
<port id="6"> <!-- output value is: [[-1.05, -1.2], [-0.2, -0.6], [-0.1, 0.4]] -->
<dim>3</dim>
<dim>2</dim>
</port>

View File

@ -5,7 +5,7 @@ ConvertLike
.. meta::
:description: Learn about ConvertLike-1 - an element-wise, type conversion
:description: Learn about ConvertLike-1 - an element-wise, type conversion
operation, which can be performed two required input tensors.
**Versioned name**: *ConvertLike-1*
@ -45,19 +45,19 @@ where ``a`` and ``b`` correspond to ``data`` and ``like`` input tensors, respect
**Example**
.. code-block:: cpp
<layer ... type="ConvertLike">
<input>
<port id="0"> < !-- type: int32 -->
<port id="0"> <!-- type: int32 -->
<dim>256</dim>
<dim>56</dim>
</port>
<port id="1"> < !-- type: float32 -->
<dim>3</dim> < !-- any data -->
<port id="1"> <!-- type: float32 -->
<dim>3</dim> <!-- any data -->
</port>
</input>
<output>
<port id="2"> < !-- result type: float32 -->
<port id="2"> <!-- result type: float32 -->
<dim>256</dim>
<dim>56</dim>
</port>

View File

@ -5,7 +5,7 @@ Convert
.. meta::
:description: Learn about Convert-1 - an element-wise, type conversion
:description: Learn about Convert-1 - an element-wise, type conversion
operation, which can be performed on a single input tensor.
**Versioned name**: *Convert-1*
@ -23,7 +23,7 @@ Conversion of negative signed integer to unsigned integer value happens in accor
The result of unsupported conversions is undefined. Output elements are represented as follows:
.. math::
o_{i} = Convert(a_{i})
where ``a`` corresponds to the input tensor.
@ -52,17 +52,17 @@ where ``a`` corresponds to the input tensor.
**Example**
.. code-block:: cpp
<layer ... type="Convert">
<data destination_type="f32"/>
<input>
<port id="0"> < !-- type: i32 -->
<port id="0"> <!-- type: i32 -->
<dim>256</dim>
<dim>56</dim>
</port>
</input>
<output>
<port id="1"> < !-- result type: f32 -->
<port id="1"> <!-- result type: f32 -->
<dim>256</dim>
<dim>56</dim>
</port>