Merged
Conversation
4 tasks
38b3e17 to
488c73c
Compare
alalek
reviewed
Jan 22, 2021
| Mat inp0 = getBlob(node_proto, 0); | ||
| Mat inp1 = getBlob(node_proto, 1); | ||
| if (inp0.size != inp1.size && inp1.total() != 1) | ||
| CV_Error(Error::StsNotImplemented, "Constant multiply with different shapes"); |
Member
There was a problem hiding this comment.
multiply
layer_type == "Mul" || layer_type == "Div"
message is not accurate here.
CV_Error_(Error::StsNotImplemented, ("Different shapes case is not supported with constant inputs: %s", layer_type.c_str()));
Comment on lines
+1172
to
+1173
| Mat out = isDiv ? inp0 / inp1 : inp0.mul(inp1); | ||
| out = out.reshape(1, inp0.dims, inp0.size); |
Member
There was a problem hiding this comment.
Do we need to reshape inputs instead? (to avoid failure of operation itself due to strong checks: inp0.size != inp1.size is allowed with .total() == 1)
Member
There was a problem hiding this comment.
Or we can use something like that:
if (isDiv)
divide(1.0, inp1, inp1);
Mat out = inp0.mul(inp1);| } | ||
| } | ||
|
|
||
| int axis = layerParams.get<int>("axis", 1); |
Member
There was a problem hiding this comment.
It make sense to add comment with link with description of default axis value (modern opsets doesn't have default): https://github.com/onnx/onnx/blob/master/docs/Changelog.md#Concat-1
Merged
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull Request Readiness Checklist
resolves: #19359
merge with extra opencv/opencv_extra#837