FrozenGene commented on a change in pull request #5753:
URL: https://github.com/apache/incubator-tvm/pull/5753#discussion_r454059023
##########
File path: src/runtime/module.cc
##########
@@ -66,9 +66,19 @@ PackedFunc ModuleNode::GetFunction(const std::string& name,
bool query_imports)
PackedFunc pf = self->GetFunction(name, GetObjectPtr<Object>(this));
if (pf != nullptr) return pf;
if (query_imports) {
- for (Module& m : self->imports_) {
- pf = m->GetFunction(name, m.data_);
- if (pf != nullptr) return pf;
Review comment:
Unluckily we can not do this. Because `m` is a `Module`, which only have
`GetFunction(const std::string& name, const ObjectPtr<Object>& sptr_to_self)`.
This is what we said before if we want to add `query_imports`, we will modify
the basic core class `Module`.
But you prompt me that I think we could do `pf
=m.operator->()->GetFunction(name, query_imports);`. Get the `ModuleNode` and
call the function. does it make sense to you?
----------------------------------------------------------------
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]