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
1D test for Reduce layer #25101
base: 5.x
Are you sure you want to change the base?
1D test for Reduce layer #25101
Conversation
@fengyuentau. I get strange result for |
This #25103 issue is also relevant |
534d372
to
9c8c9df
Compare
@dkurt could you please take a look? |
modules/dnn/test/test_layers_1d.cpp
Outdated
std::make_tuple(0, std::vector<int>{0}), | ||
std::make_tuple(1, std::vector<int>{1}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you define reduction operation on 0d / 1d tensor? Any reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formally there is not any. This test is to check if layer fails on singleton matrices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some in onnxruntime: https://github.com/microsoft/onnxruntime/blob/4a196d15940b0f328735c888e2e861d67602ffcf/onnxruntime/test/providers/cpu/reduction/reduction_ops_test.cc#L326 (Search for 0D).
67b343d
to
12cfaf9
Compare
ad5b331
to
6d8ce90
Compare
@dkurt is there anything else to do ? |
756f396
to
b29acce
Compare
cv::Mat input(input_shape.size(), input_shape.data(), CV_32F, 1.0); | ||
cv::randn(input, 0.0, 1.0); | ||
|
||
float out_value = reduceOperation(input, reduce_operation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do still we have ONE output value for matrix?
Don't write WEAK tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I do not understand you. What could be output for 1D(or 0D) matrix under reduction operation other than one output value? What do you mean by output value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case of [4, 4]
input and axis=1
output is [4, 1]
, so it also can be tested
e9619a8
to
a98994b
Compare
@opencv-alalek added what you asked. Anything else? |
This PR introduces test for
Reduce
layer to test its functionality for 1D arraysPull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.