[TVMC] Allow direct numpy inputs to run_module#7788
Merged
jwfromm merged 4 commits intoapache:mainfrom Apr 3, 2021
Merged
Conversation
Contributor
Author
|
@jwfromm @leandron @comaniac @mdw-octoml Thoughts? |
comaniac
reviewed
Apr 1, 2021
| ---------- | ||
| inputs_file : str | ||
| Path to a .npz file containing the inputs. | ||
| inputs : dict |
Contributor
There was a problem hiding this comment.
Suggested change
| inputs : dict | |
| inputs : dict, or None |
I'm actually not quite sure how this type should be in numpy-style...in Python style I'll just write Optional[Dict], but an argument with this type is usually inputs=None. Meanwhile, a function called "make_inputs_dict" but having inputs=None is also weird...
Another direction is keeping inputs to be dict, and it becomes user's resposibility to pass {} when no inputs. In this case, you don't need the None checker.
Contributor
Author
There was a problem hiding this comment.
Hi Cody,
Thanks for the feedback. Just pushed an updated version as you suggested.
Contributor
|
Thanks @CircleSpin and @comaniac. This is now merged. |
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
* progress, graph params need to figure out * black and lint * change np.load(inputs_file) to happen in drive_run * make inputs optional Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
* progress, graph params need to figure out * black and lint * change np.load(inputs_file) to happen in drive_run * make inputs optional Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
trevor-m
pushed a commit
to trevor-m/tvm
that referenced
this pull request
May 6, 2021
* progress, graph params need to figure out * black and lint * change np.load(inputs_file) to happen in drive_run * make inputs optional Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
May 11, 2021
* progress, graph params need to figure out * black and lint * change np.load(inputs_file) to happen in drive_run * make inputs optional Co-authored-by: Jocelyn <jocelyn@pop-os.localdomain>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using TVMC from python it more convenient to pass numpy arrays as inputs rather than saved files. This PR moves the file reading into drive_run to maintain the existing behavior for command line TVMC while making the python API cleaner.