diff --git a/docs/ops/opset4.md b/docs/ops/opset4.md index e377428d38b..8f8842fe5b2 100644 --- a/docs/ops/opset4.md +++ b/docs/ops/opset4.md @@ -99,6 +99,7 @@ declared in `namespace opset4`. * [Range](generation/Range_1.md) * [ReLU](activation/ReLU_1.md) * [ReadValue](infrastructure/ReadValue_3.md) +* [ReduceLp](reduction/ReduceLp_4.md) * [ReduceLogicalAnd](reduction/ReduceLogicalAnd_1.md) * [ReduceLogicalOr](reduction/ReduceLogicalOr_1.md) * [ReduceMax](reduction/ReduceMax_1.md) diff --git a/docs/ops/reduction/ReduceLp_4.md b/docs/ops/reduction/ReduceLp_4.md new file mode 100644 index 00000000000..10f5cf3a82e --- /dev/null +++ b/docs/ops/reduction/ReduceLp_4.md @@ -0,0 +1,149 @@ +## ReduceLp + +**Versioned name**: *ReduceLp-4* + +**Category**: *Reduction* + +**Short description**: *ReduceLp* operation performs reduction with finding the Lp norm of the 1st input tensor in slices specified by the 2nd input. + +**Attributes** + +* *keep_dims* + + * **Description**: If set to `True` it holds axes that are used for reduction. For each such axis, output dimension is equal to 1. + * **Range of values**: True or False + * **Type**: `boolean` + * **Default value**: False + * **Required**: *no* + +**Inputs** + +* **1**: Input tensor x of type *T1*. **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.** + +* **3**: Scalar of type *T2* with value order `p` of the normalization. Possible values: `1` for L1 or `2` for L2. **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. +* *T2*: any supported integer type. +* *T_IND*: `int64` or `int32`. + +**Detailed Description** + +Each element in the output is the result of reduction with finding a Lp norm operation along dimensions specified by the 2nd input: + + `output[i0, i1, ..., iN] = Lp[j0,..., jN](x[j0, ..., jN]))` + +Where indices i0, ..., iN run through all valid indices for the 1st input and finding the Lp norm `Lp[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 scalar value is calculated for entire input tensor. + +**Example** + +```xml + + + + + 6 + 12 + 10 + 24 + + + 2 + + + + + + 6 + 12 + 1 + 1 + + + +``` + +```xml + + + + + 6 + 12 + 10 + 24 + + + 2 + + + + + + 6 + 12 + + + +``` + +```xml + + + + + 6 + 12 + 10 + 24 + + + 1 + + + + + + 6 + 10 + 24 + + + +``` + +```xml + + + + + 6 + 12 + 10 + 24 + + + 1 + + + + + + 6 + 12 + 24 + + + +``` \ No newline at end of file