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
core: add broadcast #23965
core: add broadcast #23965
Conversation
* @param dst output array that has the given shape | ||
* @param shape target shape | ||
*/ | ||
CV_EXPORTS_W void broadcast_to(InputArray src, const std::vector<int>& shape, OutputArray dst); |
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.
Please use OpenCV naming conventions. Should be broadcastTo
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.
@vpisarev Should it be Mat
class method?
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.
Please use OpenCV naming conventions. Should be broadcastTo
Done.
Please take a look on failures of 32-bit builds: http://pullrequest.opencv.org/buildbot/builders/precommit_linux32/builds/100233
4GiB is too much for any OpenCV test. |
Target scale is down to {10, 100, 1000} now, which is about 3.8MB. |
@opencv-alalek friendly reminder. |
Hello, any reviewer updates for this pull request? |
* add broadcast_to with tests * change name * fix test * fix implicit type conversion * replace type of shape with InputArray * add perf test * add perf tests which takes care of axis * v2 from ficus expand * rename to broadcast * use randu in place of declare * doc improvement; smaller scale in perf * capture get_index by reference
Should work as
np.broadcast_to
.Benchmarks
Results on M1:
Pull 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.