testing: (tensor) Add Python unit tests for PadOp and YieldOp#5677
Draft
testing: (tensor) Add Python unit tests for PadOp and YieldOp#5677
Conversation
Co-authored-by: tobiasgrosser <521960+tobiasgrosser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add tests for new functionality
tests: (tensor) Add Python unit tests for PadOp and YieldOp
Feb 25, 2026
superlopuh
reviewed
Feb 25, 2026
Comment on lines
+171
to
+172
| assert len(yield_op.arguments) == 1 | ||
| assert yield_op.arguments[0] is pval_v |
Member
There was a problem hiding this comment.
Let's just test the tuple directly here and above, it prints a nicer message if it fails than if it fails at the incorrect length stage with 2 != 1 or whatever.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Python API unit tests for
tensor.padandtensor.yieldoperations introduced in #5669, consistent with the existing test style intests/dialects/test_tensor.py.test_pad_op_static— constructs aPadOpwith fully static low/high padding, verifies operands, static padding arrays,nofold=None, and result typetest_pad_op_dynamic— constructs aPadOpwith mixed static/dynamic padding andnofold=UnitAttr(), verifies dynamic SSA operands are stored andDYNAMIC_INDEXsentinels appear correctly in the static arraystest_yield_op— verifiesYieldOpname and operand storage viaarguments🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.