-
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
[AUTOTVM] tweak sample_int
implementation
#2677
Conversation
python/tvm/autotvm/util.py
Outdated
@@ -58,10 +60,11 @@ def sample_ints(low, high, m): | |||
""" | |||
vis = set() | |||
assert m <= high - low | |||
print("hi fam") |
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.
delete this line
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.
haha, oops
python/tvm/autotvm/util.py
Outdated
@@ -40,7 +42,7 @@ def get_rank(values): | |||
def sample_ints(low, high, m): | |||
""" | |||
Sample m different integer numbers from [low, high) without replacement | |||
This function is an alternative of `np.random.choice` when (high - low) > 2 ^ 32, in | |||
This function is an alternative of `np.random.choice` when (high - low) > 2 ^ 64, in |
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.
We don't need to modify this line., because the np.random.choice
does not work when (high - low) > 2^32, and this comment still holds.
* check in * lint * cleanup * Update util.py
* check in * lint * cleanup * Update util.py
* check in * lint * cleanup * Update util.py
* check in * lint * cleanup * Update util.py
sample_int
seems to have issues with high-low > 2^32, even in Python 3. Switching torandom
seems to work.CC @merrymercy