Skip to content

Commit

Permalink
[AUTOTVM] tweak sample_int implementation (#2677)
Browse files Browse the repository at this point in the history
* check in

* lint

* cleanup

* Update util.py
  • Loading branch information
eqy authored and merrymercy committed Feb 28, 2019
1 parent bd78079 commit ddc31fd
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit ddc31fd

Please sign in to comment.