akaashrp opened a new pull request, #20137: URL: https://github.com/apache/tvm/pull/20137
`torch.Tensor.expand` aligns existing input dimensions with the trailing dimensions of the requested shape when new leading dimensions are introduced. The Torch frontend previously resolved `-1` using the output dimension index directly. For an input shaped `(tokens, 3)`, `x.expand(2, -1, -1)` thus selected the wrong input dimensions and eventually accessed beyond the input rank. This PR: - Accounts for newly introduced leading dimensions when resolving `-1` - Aligns retained dimensions against the trailing input rank - Rejects `-1` for new leading dimensions, matching PyTorch semantics.= - Preserves the FX metadata fallback when the Relax input shape is unavailable -- 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]
