From bc28f7f26ae219844426dc774054826e948aa078 Mon Sep 17 00:00:00 2001 From: abigailt Date: Tue, 12 Jul 2022 09:45:15 +0300 Subject: [PATCH] Return None where no predictions are available --- apt/utils/datasets/datasets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apt/utils/datasets/datasets.py b/apt/utils/datasets/datasets.py index 6654e5a..0ebc998 100644 --- a/apt/utils/datasets/datasets.py +++ b/apt/utils/datasets/datasets.py @@ -258,7 +258,7 @@ class ArrayDataset(Dataset): :return: predictions as numpy array """ - raise NotImplementedError + return None class DatasetWithPredictions(Dataset): @@ -333,7 +333,7 @@ class PytorchData(Dataset): if self.is_pandas: self.features_names = x.columns - if y is not None and len(self._x) != len(self._y): + if self._y is not None and len(self._x) != len(self._y): raise ValueError('Non equivalent lengths of x and y') if self._y is not None: @@ -363,7 +363,7 @@ class PytorchData(Dataset): :return: predictions as numpy array """ - raise NotImplementedError + return None def get_sample_item(self, idx: int) -> Tensor: """