Update Reduction operations specification (#1446)

This commit is contained in:
Anton Chetverikov 2020-07-23 15:34:53 +03:00 committed by GitHub
parent 82aa1e112d
commit f90f242626
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 574 additions and 36 deletions

View File

@ -18,24 +18,30 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined *logical and* operation. **Required.**
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required.**
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
**Types**
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with *logical and* operation along dimensions specified by the 2nd input:
output[i0, i1, ..., iN] = and[j0,..., jN](x[j0, ..., jN]**2))
output[i0, i1, ..., iN] = and[j0,..., jN](x[j0, ..., jN]))
Where indices i0, ..., iN run through all valid indices for the 1st input and *logical and* operation `and[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -62,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceLogicalAnd" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceLogicalAnd" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceLogicalAnd" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```

View File

@ -18,14 +18,19 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined *logical or* operation. **Required.**
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required.**
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
**Types**
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with *logical or* operation along dimensions specified by the 2nd input:
@ -34,8 +39,9 @@ Each element in the output is the result of reduction with *logical or* operatio
Where indices i0, ..., iN run through all valid indices for the 1st input and *logical or* operation `or[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -62,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceLogicalOr" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceLogicalOr" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceLogicalOr" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```

View File

@ -1,4 +1,4 @@
## ReduceLp <a name="ReduceLp"></a>
## ReduceLp <a name="ReduceLp"></a> {#openvino_docs_ops_reduction_ReduceLp_4}
**Versioned name**: *ReduceLp-4*

View File

@ -18,24 +18,30 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined maximum operation. **Required.**
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required.**
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
** Types **
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with finding a maximum operation along dimensions specified by the 2nd input:
output[i0, i1, ..., iN] = max[j0,..., jN](x[j0, ..., jN]**2))
output[i0, i1, ..., iN] = max[j0,..., jN](x[j0, ..., jN]))
Where indices i0, ..., iN run through all valid indices for the 1st input and finding the maximum value `max[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -62,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMax" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMax" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMax" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```

View File

@ -18,25 +18,30 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined the arithmetic mean operation. **Required.**
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required.**
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
**Types**
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with finding the arithmetic mean operation along dimensions specified by the 2nd input:
output[i0, i1, ..., iN] = mean[j0,..., jN](x[j0, ..., jN]**2))
output[i0, i1, ..., iN] = mean[j0,..., jN](x[j0, ..., jN]))
Where indices i0, ..., iN run through all valid indices for the 1st input and finding the arithmetic mean `mean[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -63,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMean" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMean" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMean" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```

View File

@ -18,24 +18,30 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined minimum operation. **Required.**
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required.**
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
**Types**
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with finding a minimum operation along dimensions specified by the 2nd input:
output[i0, i1, ..., iN] = min[j0,..., jN](x[j0, ..., jN]**2))
output[i0, i1, ..., iN] = min[j0,..., jN](x[j0, ..., jN]))
Where indices i0, ..., iN run through all valid indices for the 1st input and finding the minimum value `min[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -62,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMin" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMin" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceMin" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```

View File

@ -18,24 +18,30 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined multiplication operation. **Required.**
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required.**
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
**Types**
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with multiplication operation along dimensions specified by the 2nd input:
output[i0, i1, ..., iN] = prod[j0,..., jN](x[j0, ..., jN]**2))
output[i0, i1, ..., iN] = prod[j0,..., jN](x[j0, ..., jN]))
Where indices i0, ..., iN run through all valid indices for the 1st input and multiplication `prod[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -62,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceProd" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceProd" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceProd" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```

View File

@ -18,24 +18,30 @@
**Inputs**
* **1**: Input tensor x of any data type that has defined addition operation. **Required**.
* **1**: Input tensor x of type *T1*. **Required.**
* **2**: Scalar or 1D tensor with axis indices for the 1st input along which reduction is performed. **Required**.
* **2**: Scalar or 1D tensor of type *T_IND* with axis indices for the 1st input along which reduction is performed. Accepted range is `[-r, r-1]` where where `r` is the rank of input tensor, all values must be unique, repeats are not allowed. **Required.**
**Outputs**
* **1**: Tensor of the same type as the 1st input tensor and `shape[i] = shapeOf(input1)[i]` for all `i` that is not in the list of axes from the 2nd input. For dimensions from the 2nd input tensor, `shape[i] == 1` if `keep_dims == True`, or `i`-th dimension is removed from the output otherwise.
**Types**
* *T1*: any supported numeric type.
* *T_IND*: `int64` or `int32`.
**Detailed Description**
Each element in the output is the result of reduction with addition operation along dimensions specified by the 2nd input:
output[i0, i1, ..., iN] = sum[j0,..., jN](x[j0, ..., jN]**2))
output[i0, i1, ..., iN] = sum[j0,..., jN](x[j0, ..., jN]))
Where indices i0, ..., iN run through all valid indices for the 1st input and summation `sum[j0, ..., jN]` have `jk = ik` for those dimensions `k` that are not in the set of indices specified by the 2nd input of the operation.
Corner cases:
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
1. When the 2nd input is an empty list, then this operation does nothing, it is an identity.
2. When the 2nd input contains all dimensions of the 1st input, this means that a single reduction value is calculated for entire input tensor.
**Example**
@ -62,4 +68,75 @@ Corner cases:
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceSum" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>2</dim> <!-- value is [2, 3] that means independent reduction in each channel and batch -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceSum" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<dim>24</dim>
</port>
<port id="1">
<dim>1</dim> <!-- value is [1] that means independent reduction in each channel and spatial dimensions -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>10</dim>
<dim>24</dim>
</port>
</output>
</layer>
```
```xml
<layer id="1" type="ReduceSum" ...>
<data keep_dims="False" />
<input>
<port id="0">
<dim>6</dim>
<dim>12</dim>
<dim>10</dim>
<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 -->
</port>
</input>
<output>
<port id="2">
<dim>6</dim>
<dim>12</dim>
<dim>24</dim>
</port>
</output>
</layer>
```