Skip to content

Fix #418: add tests for tfq_utility_ops.padded_to_ragged2d#1068

Open
mhucka wants to merge 7 commits into
tensorflow:masterfrom
mhucka:fix-418
Open

Fix #418: add tests for tfq_utility_ops.padded_to_ragged2d#1068
mhucka wants to merge 7 commits into
tensorflow:masterfrom
mhucka:fix-418

Conversation

@mhucka
Copy link
Copy Markdown
Member

@mhucka mhucka commented May 12, 2026

This adds some tests for previously-untested tfq_utility_ops.padded_to_ragged2d and also adds a few more cases to existing tests for tfq_utility_ops.padded_to_ragged.

mhucka added 2 commits May 12, 2026 03:14
This adds some simple tests for an untested function in
`tfq_utility_ops_test.py`.
@mhucka mhucka marked this pull request as ready for review May 12, 2026 03:37
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates tfq_utility_ops_test.py by correcting a typo, adding more test cases to test_padded_to_ragged, and implementing a new test for padded_to_ragged2d. Feedback indicates that the logic in test_padded_to_ragged2d contains an error in tensor slicing that only works for square matrices and suggests that the test implementation is too similar to the actual code, potentially missing bugs.

Comment thread tensorflow_quantum/core/ops/tfq_utility_ops_test.py Outdated
@mhucka mhucka changed the title Fix #418: add tests for padded_to_ragged2d Fix #418: add a few more tests in tfq_utility_ops_test.py May 18, 2026
@mhucka mhucka changed the title Fix #418: add a few more tests in tfq_utility_ops_test.py Fix #418: tests for tfq_utility_ops.padded_to_ragged2d May 18, 2026
@mhucka mhucka changed the title Fix #418: tests for tfq_utility_ops.padded_to_ragged2d Fix #418: add tests for tfq_utility_ops.padded_to_ragged2d May 18, 2026
@mhucka
Copy link
Copy Markdown
Member Author

mhucka commented May 18, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request expands the test suite for utility operations by adding new test cases to test_padded_to_ragged and introducing the test_padded_to_ragged2d method. Feedback suggests that the current test cases for test_padded_to_ragged2d are symmetric, which may fail to reveal an implementation bug where the first row is incorrectly used for masking instead of the first column. Including non-symmetric test cases is recommended to ensure the utility operation is correctly verified.

Comment thread tensorflow_quantum/core/ops/tfq_utility_ops_test.py
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