Repository navigation
Handle positive channel axes in Gaussian blur - #131
Merged
copybara-service[bot] merged 1 commit intoOct 24, 2026
Conversation
Shift nonnegative channel indices when adding the internal batch dimension so unbatched HWC and CHW inputs use the correct convolution groups. Add independent SciPy reference coverage for layouts, axis forms, padding, and eager/JIT execution. Fixes google-deepmind#130 Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
This was referenced Oct 5, 2026
claudiofantacci
self-requested a review
October 12, 2026 21:55
claudiofantacci
approved these changes
Oct 12, 2026
claudiofantacci
approved these changes
Oct 24, 2026
copybara-service
Bot
merged commit Oct 24, 2026
ad33319
into
google-deepmind:master
12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unbatched HWC and CHW images fail in
gaussian_blurwhen their channel axis is given as a positive index. Adding the internal batch dimension shifts that index, so the convolution derives its feature-group count from the wrong dimension.Advance nonnegative channel indices when inserting the batch dimension. Add regression coverage comparing values, shapes, and dtypes against independent SciPy 2D convolution for HWC/CHW, batched/unbatched inputs, positive/negative axes, SAME/VALID padding, and eager/JIT execution.
Fixes #130.
Validation:
python -m pytest -q -n 2 dm_pix).git diff --check: passes.Tested on CPU with Python 3.12.14, JAX/jaxlib 0.11.2, SciPy 1.18.1, NumPy 2.5.3, and TensorFlow 2.21.0. GPU/TPU execution was not run.