[MetaSchedule][Minor] Update CPU Flush ArgParse Type#11792
Merged
junrushao merged 1 commit intoapache:mainfrom Jun 21, 2022
Merged
[MetaSchedule][Minor] Update CPU Flush ArgParse Type#11792junrushao merged 1 commit intoapache:mainfrom
junrushao merged 1 commit intoapache:mainfrom
Conversation
junrushao
approved these changes
Jun 20, 2022
Member
junrushao
left a comment
There was a problem hiding this comment.
I don’t have strong opinion, so if you prefer this way, let’s get it in
blackkker
pushed a commit
to blackkker/tvm
that referenced
this pull request
Jul 7, 2022
Previously `cpu-flush` option existed as a boolean or integer argument, which is a bit counter-intuitive because for argparse, any non-empty string such as `False` will be parsed to `True` when using as a boolean and integer a little bit vague here IMHO. This PR used a function from `distutils` to directly parse input string to boolean, which makes the usage more stragiht-forward like `--cpu-flush True` or `--cpu-flush False`. Meanwhile it still supports usage of `0/1` and made sure the argument is always required.
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.
Previously
cpu-flushoption existed as a boolean or integer argument, which is a bit counter-intuitive because for argparse, any non-empty string such asFalsewill be parsed toTruewhen using as a boolean and integer a little bit vague here IMHO. This PR used a function fromdistutilsto directly parse input string to boolean, which makes the usage more stragiht-forward like--cpu-flush Trueor--cpu-flush False. Meanwhile it still supports usage of0/1and made sure the argument is always required.CC: @junrushao1994