-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mod supoort in relay.build #3424
Conversation
cc @zhiics This seems to be an artifact of incomplete migration to module, I agree with the change but would suggest we move to only require module and add deprecation warnings to function as input |
python/tvm/relay/build_module.py
Outdated
@@ -192,6 +192,9 @@ def build(func, target=None, target_host=None, params=None): | |||
|
|||
with tophub_context: | |||
bld_mod = BuildModule() | |||
if "tvm.relay.module.Module" in str(type(func)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not the best way to check a type in python use
isinstance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I changed it to use isinstance
here.
yeah, I was actually aware of this. But I think this |
1303012
to
4629d76
Compare
In all tutorials to compile models we use helper method |
4629d76
to
3907d50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@tqchen Can you review it one more time? |
Recently it was a change which changes
from_<framework>
output to returnmod
instead offunc
#3353But
relay.build
still supportsfunc
as an input. This is why all existing users' scripts to compile models should be updated. All people need to add extra line to their scripts beforerelay.build
In order to avoid all people fixing their compile scripts I think we need to add support for
mod
input torelay.build
.This PR adds
mod
input support torelay.build
and updates TFLite tutorial.I can update other tutorials if we agree with this change.