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 2019/11/17 18:40:45 UTC

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4357: [Relay tests] AlterOpLayout - Temporary attr update

tqchen commented on a change in pull request #4357: [Relay tests] AlterOpLayout - Temporary attr update
URL: https://github.com/apache/incubator-tvm/pull/4357#discussion_r347151776
 
 

 ##########
 File path: src/relay/ir/op.cc
 ##########
 @@ -95,6 +95,17 @@ const bool Op::HasGenericAttr(const std::string& key) {
   return true;
 }
 
+// Resets attr of the OpMap.
+void OpRegistry::reset_attr(const std::string& key) {
+  OpManager* mgr = OpManager::Global();
+  std::lock_guard<std::mutex> lock(mgr->mutex);
+  std::unique_ptr<GenericOpMap>& op_map = mgr->attr[key];
+  if (op_map == nullptr) {
+    return;
+  }
+  op_map->data_.clear();
 
 Review comment:
   per https://docs.tvm.ai/contribute/code_review.html#ensure-test-coverage
   
   Need testcase for reset_attr.
   The current implementation resets the attr of other ops along the current one, which is not correct. 
   

----------------------------------------------------------------
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


With regards,
Apache Git Services