Skip to content

Commit

Permalink
Chronos: an error message is added to AutoformerForecaster.predict() (i…
Browse files Browse the repository at this point in the history
…ntel-analytics#5483)

When the input data to AutoformerForecaster.predict() is incorrect, the error message is confusing. Thus, a new error message is added.
  • Loading branch information
plusbang authored and ForJadeForest committed Sep 20, 2022
1 parent 3dc4985 commit d6ab2ba
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ def predict(self, data, batch_size=32):
"""
if self.distributed:
invalidInputError(False, "distributed is not support in Autoformer")
invalidInputError(isinstance(data, tuple) or isinstance(data, DataLoader),
"The input data to predict() support formats: numpy ndarray tuple"
f" and pytorch dataloader, but found {type(data)}.")
if isinstance(data, tuple):
data = DataLoader(TensorDataset(torch.from_numpy(data[0]),
torch.from_numpy(data[1]),
Expand Down

0 comments on commit d6ab2ba

Please sign in to comment.