Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[CPU] Broadcast check has been added to the ConvertPowerToPowerIEMatcher transformation. #3132

Merged
merged 2 commits into from
Nov 16, 2020

Conversation

maxnick
Copy link
Contributor

@maxnick maxnick commented Nov 13, 2020

Since the PowerIE operation has a single input, the transformation checks if the second input (powers) is filled with identical numbers, and if so, it instantiates PowerIE operation with the same input and power as a parameter. But according to the specification, ngraph power operation supports ONNX broadcast rule between two inputs. In the transformation, the broadcast rule was not checked and, for example, in the case where two inputs have the shapes { 2, 17, 5, 1 }, { 1, 17, 1, 4 } for input data and powers respectively, the former would be passed to the PowerIE without corresponding broadcasting (in this case the result shape has to be {2, 17, 5, 4}), which in its turn would result in an error.
It this PR, additional broadcast check has been added to the transformation. The Power operation will be converted to PowerIE only if the second input does not affect the shape of the first input.

@maxnick maxnick requested review from a team, dmitry-gorokhov and ilyachur and removed request for a team November 13, 2020 17:39
@maxnick maxnick force-pushed the Power_to_PowerIE_fix branch from 22472f7 to 951a4d1 Compare November 16, 2020 08:48
@dmitry-gorokhov dmitry-gorokhov merged commit ca36b91 into openvinotoolkit:master Nov 16, 2020
mryzhov pushed a commit to mryzhov/openvino that referenced this pull request Nov 17, 2020
…her transformation. (openvinotoolkit#3132)

* [CPU] Added broadcast check to the ConvertPowerToPowerIE transformation.

* [CPU] Eltwise single layer test instance extended with a two inputs case.
mryzhov pushed a commit to mryzhov/openvino that referenced this pull request Dec 16, 2020
…her transformation. (openvinotoolkit#3132)

* [CPU] Added broadcast check to the ConvertPowerToPowerIE transformation.

* [CPU] Eltwise single layer test instance extended with a two inputs case.
@maxnick maxnick deleted the Power_to_PowerIE_fix branch October 27, 2021 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants