-
Notifications
You must be signed in to change notification settings - Fork 157
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
[compute/cker] Introduce the ShapeIterator #14311
base: master
Are you sure you want to change the base?
Conversation
This commit introduces an utility that effectively makes the Shape objects iterable. It's an iterator class which points to the individual dimensions in the shape and allows the interoperability of the Shape class and STL algorithms as well as range-based for loops. The iterator fulfills the requirements of a bidirectional iterator. In addition this commit contains one extra utility which allows the Shape objects conversion to std::string by contatenating them with a comma. ONE-DCO-1.0-Signed-off-by: Tomasz Dolbniak <t.dolbniak@partner.samsung.com>
@nnfw-bot test onert-x64-release |
@zetwhite could you please review or suggest particular reviewers for this PR? |
|
@hseok-oh the purpose is to extend the ability to iterate over the Shape dimensions. With the Shape class' API it's only possible to use it with traditional indexed loops and the
or with algorithms expecting a pair of iterators denoting a range of dimensions:
It's difficult to list all possible use cases but the main thing I was missing was the ability to use STL algorithms when traversing a Shape object. Regarding the test naming, I know there's a requirement for the number of negative tests but couldn't really come up with a good negative test for this utility. Should that be changed in any way? |
The Anyway, this PR looks good. |
Co-authored-by: SeungHui Youn <61981457+zetwhite@users.noreply.github.com>
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.
LGTM
This commit introduces a utility that effectively makes the Shape objects iterable. It's an iterator class which points to the individual dimensions in the shape and allows the interoperability of the Shape class and STL algorithms as well as range-based for loops. The iterator fulfills the requirements of a bidirectional iterator.
In addition this commit contains one extra utility which allows the Shape objects conversion to std::string by contatenating them with a comma.
ONE-DCO-1.0-Signed-off-by: Tomasz Dolbniak t.dolbniak@partner.samsung.com