-
Notifications
You must be signed in to change notification settings - Fork 996
[QNN] Fix LiftConstantScalarOperands to handle aten.pow.Scalar #18994
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
Changes from all commits
2e07748
dd102b5
fa192b4
0c4b191
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1713,6 +1713,26 @@ def test_qnn_backend_pow_tensor_scalar(self): | |||||||||
| index += 1 | ||||||||||
| self.lower_module_and_test_output(module, sample_input) | ||||||||||
|
|
||||||||||
| def test_qnn_backend_pow_scalar(self): | ||||||||||
| test_comb = [ | ||||||||||
| { | ||||||||||
| QCOM_MODULE: [ | ||||||||||
| PowScalar(), # base=2.0, default # noqa: F405 | ||||||||||
| PowScalar(3.0), # base=3.0, common case # noqa: F405 | ||||||||||
| PowScalar(9), # base=9, integer exp case # noqa: F405 | ||||||||||
| PowScalar(0.5), # base=0.5, fractional case # noqa: F405 | ||||||||||
|
Comment on lines
+1722
to
+1723
|
||||||||||
| PowScalar(9), # base=9, integer exp case # noqa: F405 | |
| PowScalar(0.5), # base=0.5, fractional case # noqa: F405 | |
| PowScalar(9), # base=9, integer base case # noqa: F405 | |
| PowScalar(0.5), # base=0.5, fractional base case # noqa: F405 |
Copilot
AI
Apr 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the floating-point test: these comments describe exponent cases, but the varied constructor argument in PowScalar(...) is the scalar base. Please adjust the comments to refer to the base to prevent misunderstanding.
| PowScalar(9), # base=9, integer exp case # noqa: F405 | |
| PowScalar(0.5), # base=0.5, fractional case # noqa: F405 | |
| PowScalar(9), # base=9, integer base case # noqa: F405 | |
| PowScalar(0.5), # base=0.5, fractional base case # noqa: F405 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add/extend a unit test that exercises
aten.pow.Scalarso this regression stays fixed (e.g., export a tiny module usingtorch.pow(2.0, x), runLiftConstantScalarOperands, and assert the node target becomesaten.pow.Tensor_Tensorand the pass doesn’t crash whenargs[0]is a Python float).