-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RUNTIME] Add clear() function in tvm::Map class #7826
Conversation
@Beya2019 Thanks for the contribution! However, the change here may not be correct: never erase elements in the container when iterating them 🙂 |
The best way to clear a |
OK, according the suggestion, re-creating one call default constructor function: Do you think this is ok? |
That looks good. Would you like to add some unittests? Thanks a lot! |
OK. Add the unittests |
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. Thanks for the contribution!
Co-authored-by: honghua.cao <honghua.cao@streamcomputing.com>
Co-authored-by: honghua.cao <honghua.cao@streamcomputing.com>
Co-authored-by: honghua.cao <honghua.cao@streamcomputing.com>
Co-authored-by: honghua.cao <honghua.cao@streamcomputing.com>
std::map and std::unordered_map have the clear() member function to clear the contents.
tvm::Array also has the clear() member function.
In order to be consistent with tvm::Array/std::map/std::unordered_map, we add the clear() member function in tvm::Map class used existing function implementation
@tqchen @yzhliu Would you please have a look at this? Thanks very much.