Skip to content

Accept 1D and 2D inputs in BatchNormalization #663

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

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

robertknight
Copy link
Owner

Per the spec, BatchNormalization should accept inputs of rank 1 and up. https://huggingface.co/timm/levit_128s.fb_dist_in1k for example applies batch norm to 2D inputs.

Normalization of 1D and 2D inputs is currently very inefficient due to the overhead of applying slice-oriented kernels to single-element slices, but at least it works now.

Per the spec, BatchNormalization should accept inputs of rank 1 and up.
https://huggingface.co/timm/levit_128s.fb_dist_in1k for example applies batch
norm to 2D inputs.

Normalization of 1D and 2D inputs is currently very inefficient due to the
overhead of applying slice-oriented kernels to single-element slices, but at
least it works now.
@robertknight robertknight merged commit f5c1d04 into main Apr 13, 2025
2 checks passed
@robertknight robertknight deleted the batch-norm-2d-input branch April 13, 2025 06:32
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.

1 participant