Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aggregator.py #2995

Merged
merged 11 commits into from
Oct 17, 2024
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)

zina-cs marked this conversation as resolved.
Show resolved Hide resolved
if len(self.dataset) < subset_size:
l-bat marked this conversation as resolved.
Show resolved Hide resolved
raise nncf.UnsupportedDatasetError(
DATASET_SIZE_ERROR.format(len(self.dataset), subset_size)
)

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