Commit eb056bd4 by Haichen Shen Committed by eqy

[Bugfix] Fix AutoTVM bug (#3462)

* fix autotvm

* fix bug when heap_items is empty
parent 3247d317
......@@ -78,7 +78,7 @@ class SimulatedAnnealingOptimizer(ModelOptimizer):
heap_items = [(float('-inf'), - 1 - i) for i in range(num)]
heapq.heapify(heap_items)
in_heap = set(exclusive)
in_heap.update([x for x in heap_items])
in_heap.update([x[1] for x in heap_items])
for s, p in zip(scores, points):
if s > heap_items[0][0] and p not in in_heap:
......@@ -128,9 +128,9 @@ class SimulatedAnnealingOptimizer(ModelOptimizer):
time.time() - tic)
heap_items.sort(key=lambda item: -item[0])
heap_items = [x for x in heap_items if x >= 0]
logger.debug("SA iter: %d\tlast_update: %d\tmax-0: %.2f\tmax-1: %.2f\telapsed: %.2f",
k, k_last_modify, heap_items[-1][0], heap_items[0][0], time.time() - tic)
heap_items = [x for x in heap_items if x[0] >= 0]
logger.debug("SA iter: %d\tlast_update: %d\telapsed: %.2f",
k, k_last_modify, time.time() - tic)
logger.debug("SA Maximums: %s", heap_items)
if self.persistent:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment