diff --git a/python/chronos/src/bigdl/chronos/forecaster/autoformer_forecaster.py b/python/chronos/src/bigdl/chronos/forecaster/autoformer_forecaster.py index fb09b814271..427c0741abb 100644 --- a/python/chronos/src/bigdl/chronos/forecaster/autoformer_forecaster.py +++ b/python/chronos/src/bigdl/chronos/forecaster/autoformer_forecaster.py @@ -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]),