Skip to content

[Fix][Relax] Preserve Torch integral power semantics - #20135

Open
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:upstream/torch-integral-powers
Open

[Fix][Relax] Preserve Torch integral power semantics#20135
akaashrp wants to merge 1 commit into
apache:mainfrom
akaashrp:upstream/torch-integral-powers

Conversation

@akaashrp

Copy link
Copy Markdown
Contributor

Preserve PyTorch dtype and negative-base behavior when importing tensor powers with nonnegative integral scalar exponents.

This PR:

  • Applies PyTorch’s scalar exponent conversion before lowering
  • Preserves dtype promotion for integer tensors raised to floating-point scalars
  • Lowers integral exponents to multiplication using exponentiation by squaring
  • Leaves negative and fractional exponents on the general power path

@yongwww yongwww closed this Aug 17, 2026
@yongwww yongwww reopened this Aug 17, 2026
@akaashrp
akaashrp force-pushed the upstream/torch-integral-powers branch from 0457211 to a4717db Compare August 17, 2026 06:15
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.

2 participants