Skip to content

[tosa] : Don't use makeTorchShapeCompatible when shape is used to construct TensorType.#4453

Merged
sahas3 merged 2 commits intollvm:mainfrom
sahas3:torchShape
Feb 3, 2026
Merged

[tosa] : Don't use makeTorchShapeCompatible when shape is used to construct TensorType.#4453
sahas3 merged 2 commits intollvm:mainfrom
sahas3:torchShape

Conversation

@sahas3
Copy link
Member

@sahas3 sahas3 commented Feb 2, 2026

makeTorchShapeCompatible changes kDynamic to -1 which is not valid when using the shape with -1 to construct a tensor type and results in an assert. There are 60 other usage of makeTorchShapeCompatible and those usages seems correct to me as for most ops there is either a check for hasStaticShape or a subsequent usage of makeShapeLLVMCompatible that turns -1 back to kDynamic before a tensor type is constructed.

Copy link
Collaborator

@sjarus sjarus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

@sahas3 sahas3 merged commit 9a7cd96 into llvm:main Feb 3, 2026
3 checks passed
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

Comments