[CPU] Broadcast check has been added to the ConvertPowerToPowerIEMatcher transformation. #3132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.