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

 ##########
 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:
   I see. I will take a look. I have misunderstood the registry codebase then.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to