Skip to content

Ceil integer attributes in undiscretize when clip_to_range is False - #233

Merged
copybara-service[bot] merged 1 commit into
mainfrom
cl/994011854
Oct 6, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
cl/994011854

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Ceil integer attributes in undiscretize when clip_to_range is False

Previously, undiscretize only applied np.ceil and cast to int when both dtype == 'int' and clip_to_range == True. When clip_to_range == False, integer attributes returned un-ceiled float midpoints or uniform samples (such as 0.5) even when an integer sentinel was provided.

Always apply np.ceil when dtype == 'int' (preserving NaN when sentinel is None), and cast to int whenever clip_to_range is True or sentinel is an integer.

@copybara-service
copybara-service Bot force-pushed the cl/994011854 branch 3 times, most recently from 7e5cb2e to e96040c Compare October 6, 2026 01:21
@copybara-service
copybara-service Bot merged commit 2d654b3 into main Oct 6, 2026
2 checks passed
@copybara-service
copybara-service Bot deleted the cl/994011854 branch October 6, 2026 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants