Skip to content

Conversation

copybara-service[bot]
Copy link

Make UnitNormalization layer stateless.

There is no need to resolve negative axes in build, as tf.linalg.l2_normalize can handle them. Kept the build method to validate the axes in the context of the input_shape. Also added call to super.build(...) per best practice on Keras 2.

Note that in Keras 3, UnitNormalization is already stateless.

There is no need to resolve negative axes in `build`, as `tf.linalg.l2_normalize` can handle them. Kept the build method to validate the axes in the context of the `input_shape`. Also added call to `super.build(...)` per best practice on Keras 2.

Note that in Keras 3, `UnitNormalization` is already stateless.

PiperOrigin-RevId: 699285760
@copybara-service copybara-service bot merged commit 916ca64 into master Nov 22, 2024
@copybara-service copybara-service bot deleted the test_699253410 branch November 22, 2024 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants