You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/04/12 06:50:44 UTC

[GitHub] [tvm] Beya2019 opened a new pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Beya2019 opened a new pull request #7826:
URL: https://github.com/apache/tvm/pull/7826


   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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #7826:
URL: https://github.com/apache/tvm/pull/7826#issuecomment-818444150


   That looks good. Would you like to add some unittests? Thanks a lot!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Beya2019 commented on pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
Beya2019 commented on pull request #7826:
URL: https://github.com/apache/tvm/pull/7826#issuecomment-818469369


   > That looks good. Would you like to add some unittests? Thanks a lot!
   
   OK. Add the unittests `TEST(Map, Clear)` in `tests/cpp/container_test.cc`. Please help review this submit again.Thanks a lot.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] Beya2019 commented on pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
Beya2019 commented on pull request #7826:
URL: https://github.com/apache/tvm/pull/7826#issuecomment-818395743


   > The best way to clear a `tvm::Map` might be just re-creating one IMO
   
   OK, according the suggestion, re-creating one call default constructor function: `Map() { data_ = MapNode::Empty(); }` , so clear function can call `data_ = MapNode::Empty();`  directly  IMO
   
   Do you think this is ok?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 merged pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
junrushao1994 merged pull request #7826:
URL: https://github.com/apache/tvm/pull/7826


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] tqchen commented on pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
tqchen commented on pull request #7826:
URL: https://github.com/apache/tvm/pull/7826#issuecomment-817774787


   cc @junrushao1994 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #7826:
URL: https://github.com/apache/tvm/pull/7826#issuecomment-818047270


   @Beya2019 Thanks for the contribution! However, the change here may not be correct: never erase elements in the container when iterating them :slightly_smiling_face: 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] junrushao1994 commented on pull request #7826: [RUNTIME] Add clear() function in tvm::Map class

Posted by GitBox <gi...@apache.org>.
junrushao1994 commented on pull request #7826:
URL: https://github.com/apache/tvm/pull/7826#issuecomment-818048870


   The best way to clear a `tvm::Map` might be just re-creating one IMO


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org