Skip to content

Conversation

HurSungYun
Copy link
Contributor

@HurSungYun HurSungYun commented Sep 29, 2025

Currently, ShapeEquals only compared element-wise dimensions using zip(), which meant that two shapes with the same prefix but different rank could be considered equal like

t = tensor_util.make_tensor_proto([10, 20, 30, 40], shape=[2, 2])
ShapeEquals(t, [2,2,1])    # returned True (wrong)

This patch adds an explicit length check so that rank of the shape must also match.

If anything is incorrect, feel free to close this PR.

@google-ml-butler google-ml-butler bot added the size:XS CL Change Size: Extra Small label Sep 29, 2025
@HurSungYun HurSungYun changed the title fix: shapeEquals checks length of the shape fix: shapeEquals checks length of the shape explictly Sep 29, 2025
@HurSungYun HurSungYun marked this pull request as ready for review September 29, 2025 14:25
@HurSungYun HurSungYun changed the title fix: shapeEquals checks length of the shape explictly fix: add explicit length check in ShapeEquals Sep 29, 2025
@github-project-automation github-project-automation bot moved this to Assigned Reviewer in PR Queue Oct 2, 2025
@keerthanakadiri keerthanakadiri added the python Pull requests that update Python code label Oct 2, 2025
@google-ml-butler google-ml-butler bot added the awaiting review Pull request awaiting review label Oct 2, 2025
Copy link
Collaborator

@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for also updating the tests!

@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Oct 3, 2025
@github-project-automation github-project-automation bot moved this from Assigned Reviewer to Approved by Reviewer in PR Queue Oct 3, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Oct 3, 2025
@HurSungYun
Copy link
Contributor Author

@mihaimaruseac Thank you for the review! Please merge this PR when you have time.

@mihaimaruseac
Copy link
Collaborator

Please consult CONTRIBUTING.md (as one should do always before contributing to a new codebase), there is a process with automatic integration inside the Google codebase and a new review there. We don't merge the PRs via the GitHub button.

@HurSungYun
Copy link
Contributor Author

Thank you for letting me know. I’ll wait to see the integration completed. Please let me know if there’s anything else I should do.

@keerthanakadiri keerthanakadiri removed the awaiting review Pull request awaiting review label Oct 10, 2025
@HurSungYun HurSungYun closed this Oct 10, 2025
@copybara-service copybara-service bot merged commit 63b3c22 into tensorflow:master Oct 10, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from Approved by Reviewer to Closed/Rejected in PR Queue Oct 10, 2025
@github-project-automation github-project-automation bot moved this from Closed/Rejected to Merged in PR Queue Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update Python code ready to pull PR ready for merge process size:XS CL Change Size: Extra Small

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

5 participants