Skip to content
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

Merged
merged 4 commits into from
Feb 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/tvm/autotvm/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import multiprocessing
import time

from random import randrange

import numpy as np

from .. import expr, ir_pass
Expand Down Expand Up @@ -59,9 +61,9 @@ def sample_ints(low, high, m):
vis = set()
assert m <= high - low
while len(vis) < m:
new = np.random.randint(low, high)
new = randrange(low, high)
while new in vis:
new = np.random.randint(low, high)
new = randrange(low, high)
vis.add(new)

return list(vis)
Expand Down