Skip to content

Remove unsafe Shape::mutable_dynamic_dimensions(). #25341

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 17, 2025

Conversation

copybara-service[bot]
Copy link

Remove unsafe Shape::mutable_dynamic_dimensions().

Some combinations of (dimension_size, is_dynamic) are invalid (e.g. a static dimension cannot have a size = `kUnboundedSize`). To ensure that `Shape`'s invariants aren't broken, we shouldn't expose `dimensions` and `dynamic_dimensions` as mutable values directly. Instead, all changes to these properties should go through safe `Shape` APIs that validate the arguments (e.g. `set_dynamic_dimension()`).

Luckily, `mutable_dynamic_dimensions()` is unused, so we can just remove it.

PiperOrigin-RevId: 748540904
@copybara-service copybara-service bot merged commit 57e2700 into main Apr 17, 2025
@copybara-service copybara-service bot deleted the test_748372224 branch April 17, 2025 05:14
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