javierdejesusda opened a new pull request, #19660:
URL: https://github.com/apache/tvm/pull/19660

   `torch.pow` on an integer tensor returns an integer result, but the PyTorch 
frontend lowered it to `relax.op.power`, which fails `LegalizeOps` with `power 
only applies to float` (TOPI `power` / `tvm::pow` requires a floating-point 
input).
   
   This decomposes an integer base raised to a constant non-negative integer 
exponent into repeated multiplication, so the result stays integral and matches 
PyTorch. Float bases and non-constant or tensor exponents keep using 
`relax.op.power` unchanged. The ONNX frontend already uses the same 
decomposition (`x**3 = x*x*x`).
   
   Added structural tests covering both the FX and ExportedProgram import paths.
   
   Fixes #19550


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to