-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
34 changes: 33 additions & 1 deletion
34
docs/low_precision_transformations/transformations/step3_main/arithmetic/add.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,33 @@ | ||
# OpenVINO™ Low Precision Transformations: AddTransformation {#openvino_docs_IE_DG_lpt_AddTransformation} | ||
# OpenVINO™ Low Precision Transformations: AddTransformation {#openvino_docs_IE_DG_lpt_AddTransformation} | ||
|
||
The transformation propagates dequantization operations from one input branch to another and below `Add` operation. One or both branches can be quantized. As result, one `Add` operation input branch is in low precision without dequantization operations, another input branch is in original precision with updated dequantization operations. | ||
|
||
During inference dequantization operations from another input will be fused in previous operation, for example in `Convolution` or `FakeQuantize`. This approach allows to infer `Add` operation in the most optimal way. | ||
|
||
## Subgraph before transformation | ||
The subgraph with quantized `Add` operation before transformation: | ||
|
||
\f[ | ||
y_{ch,i}=(scale1_{ch} * (x1_{ch,i} - shift1_{ch})) + (scale2_{ch} * (x2_{ch,i} - shift2_{ch})) | ||
\f] | ||
|
||
![Add before](img/add.common.png) | ||
|
||
## Subgraph after transformation | ||
The subgraph with `Add` operation after the transformation: | ||
|
||
\f[ | ||
y_{ch,i}=scale2_{ch} * (scale1_{ch}' * (x1_{ch,i} - shift1_{ch}') + x2_{ch,i}) | ||
\f] | ||
|
||
where: | ||
|
||
\f[ | ||
scale1_{ch}' = scale1_{ch} / scale2_{ch} | ||
\f] | ||
|
||
\f[ | ||
shift1_{ch}' = shift1_{ch} + scale2_{ch} * shift2_{ch} / scale1_{ch} | ||
\f] | ||
|
||
![Add before](img/add.transformed.png) |
3 changes: 3 additions & 0 deletions
3
...cision_transformations/transformations/step3_main/arithmetic/img/add.common.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...cision_transformations/transformations/step3_main/arithmetic/img/add.common.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...n_transformations/transformations/step3_main/arithmetic/img/add.transformed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
...n_transformations/transformations/step3_main/arithmetic/img/add.transformed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.