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 2020/11/06 01:15:34 UTC

[GitHub] [incubator-tvm] junrushao1994 opened a new pull request #6859: [Bugfix][Module] Fix recursive GetFunction in runtime::Module

junrushao1994 opened a new pull request #6859:
URL: https://github.com/apache/incubator-tvm/pull/6859


   This PR fixes a bug that affects the behavior of `ModuleNode::GetFunction` when `query_import=True`
   
   CC: @jwfromm @tqchen @icemelon9 


----------------------------------------------------------------
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] [incubator-tvm] tqchen commented on pull request #6859: [Bugfix][Module] Fix recursive GetFunction in runtime::Module

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


   Thanks @junrushao1994 ! Please also send another PR to https://github.com/apache/incubator-tvm/tree/v0.7 branch


----------------------------------------------------------------
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] [incubator-tvm] giuseros commented on a change in pull request #6859: [Bugfix][Module] Fix recursive GetFunction in runtime::Module

Posted by GitBox <gi...@apache.org>.
giuseros commented on a change in pull request #6859:
URL: https://github.com/apache/incubator-tvm/pull/6859#discussion_r518702980



##########
File path: src/runtime/module.cc
##########
@@ -68,6 +68,9 @@ PackedFunc ModuleNode::GetFunction(const std::string& name, bool query_imports)
   if (query_imports) {
     for (Module& m : self->imports_) {
       pf = m.operator->()->GetFunction(name, query_imports);
+      if (pf != nullptr) {
+        return pf;
+      }
     }
   }
   return pf;

Review comment:
       Would it be worth (and correct) putting an assert like `ICHECK(pf != nullptr) << "unable to get the function pointer"` ?




----------------------------------------------------------------
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] [incubator-tvm] tqchen commented on a change in pull request #6859: [Bugfix][Module] Fix recursive GetFunction in runtime::Module

Posted by GitBox <gi...@apache.org>.
tqchen commented on a change in pull request #6859:
URL: https://github.com/apache/incubator-tvm/pull/6859#discussion_r518748554



##########
File path: src/runtime/module.cc
##########
@@ -68,6 +68,9 @@ PackedFunc ModuleNode::GetFunction(const std::string& name, bool query_imports)
   if (query_imports) {
     for (Module& m : self->imports_) {
       pf = m.operator->()->GetFunction(name, query_imports);
+      if (pf != nullptr) {
+        return pf;
+      }
     }
   }
   return pf;

Review comment:
       The expected behvaior of this function is to return nullptr for functions inavailable, so we don't want to put ICHECKhere




----------------------------------------------------------------
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] [incubator-tvm] tqchen merged pull request #6859: [Bugfix][Module] Fix recursive GetFunction in runtime::Module

Posted by GitBox <gi...@apache.org>.
tqchen merged pull request #6859:
URL: https://github.com/apache/incubator-tvm/pull/6859


   


----------------------------------------------------------------
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] [incubator-tvm] junrushao1994 commented on pull request #6859: [Bugfix][Module] Fix recursive GetFunction in runtime::Module

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


   @tqchen Thanks! Backport PR: #6866.


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