Skip to content

Commit

Permalink
Fix simple symmetric selection pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ofirgo committed Feb 13, 2025
1 parent 7ff5e71 commit 795e50d
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def hist():

@pytest.fixture
def bounded_hist():
# here, we want to test the threshold selection for
np.random.seed(42)
size = (32, 32, 3)
num_bins = 2048
Expand All @@ -48,15 +49,15 @@ def bounded_hist():
return count, bins


err_methods_to_test = [e.name for e in QuantizationErrorMethod if e != QuantizationErrorMethod.HMSE]
err_methods_to_test = [e for e in QuantizationErrorMethod if e != QuantizationErrorMethod.HMSE]


@pytest.mark.parametrize("error_method", err_methods_to_test)
def test_symmetric_threshold_selection(error_method, hist):
counts, bins = hist

search_res = symmetric_selection_histogram(bins, counts, 2, 8, Mock(), Mock(), Mock(), Mock(),
MIN_THRESHOLD, QuantizationErrorMethod[error_method], True)
MIN_THRESHOLD, error_method, True)

assert THRESHOLD in search_res
assert SIGNED in search_res
Expand All @@ -69,7 +70,7 @@ def test_symmetric_threshold_selection_bounded_activation(error_method, bounded_
counts, bins = bounded_hist

search_res = symmetric_selection_histogram(bins, counts, 2, 8, Mock(), Mock(), Mock(), Mock(),
MIN_THRESHOLD, QuantizationErrorMethod[error_method], False)
MIN_THRESHOLD, error_method, False)

assert THRESHOLD in search_res
assert SIGNED in search_res
Expand Down

0 comments on commit 795e50d

Please sign in to comment.