Skip to content

Commit

Permalink
Update aggregator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zina-cs authored Sep 27, 2024
1 parent c93676d commit 4a88a47
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions nncf/common/tensor_statistics/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
"Calibration dataset must not be empty. Please provide calibration dataset with at least one sample."
)

DATASET_SIZE_ERROR = "The dataset size ({}) is smaller than the subset size ({})."


class StatisticsAggregator(ABC):
"""
Expand Down Expand Up @@ -82,6 +84,11 @@ def collect_statistics(self, model: TModel, graph: NNCFGraph) -> None:
empty_statistics = False
if empty_statistics:
raise nncf.ValidationError(EMPTY_DATASET_ERROR)

if len(self.dataset) < subset_size:
raise nncf.UnsupportedDatasetError(
DATASET_SIZE_ERROR.format(len(self.dataset), subset_size)
)

def register_statistic_points(self, statistic_points: StatisticPointsContainer) -> None:
"""
Expand Down

0 comments on commit 4a88a47

Please sign in to comment.