Skip to content

Commit

Permalink
Address some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
guberti committed Aug 23, 2022
1 parent 6960e5b commit 131e56a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/tvm/autotvm/task/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ class ApplyHistoryBest(DispatchContext):
Parameters
----------
records : Records or iterator of Records objects, where a Records
object is a path-like object, a file-like object, or an
iterator of (MeasureInput, MeasureResult).
records : None, Records, or iterator of Records objects, where a
Records object is a path-like object, a file-like object,
or an iterator of (MeasureInput, MeasureResult).
Collection of tuning records. If multiple Records objects are passed, their
contents will be merged.
"""

def __init__(self, records):
def __init__(self, records: Union[None, Records, Iterable[Records]]):
super(ApplyHistoryBest, self).__init__()

self.best_by_targetkey = {}
Expand Down Expand Up @@ -471,7 +471,7 @@ def __init__(self, records: Records):
from ..record import load_from_file, load_from_buffer

super(ApplyGraphBest, self).__init__()
if isinstance(records, str, bytes, PathLike):
if isinstance(records, (str, bytes, PathLike)):
records = load_from_file(records)
elif isinstance(records, TextIOBase):
records = load_from_buffer(records)
Expand Down

0 comments on commit 131e56a

Please sign in to comment.