Skip to content

Use expanded extent for empty check in RemoveEmptyPass#604

Merged
jacobhinkle merged 6 commits intomainfrom
zero_expanded_extent
Jul 19, 2023
Merged

Use expanded extent for empty check in RemoveEmptyPass#604
jacobhinkle merged 6 commits intomainfrom
zero_expanded_extent

Conversation

@jacobhinkle
Copy link
Collaborator

When replacing empty tensors with full in RemoveEmptyPass (#543), we use the extent to determine the output shape. This is a problem if that tensor was the output of an expand call, because then even a tensor that is not empty might appear to be so if an expanded extent is zero. This change addresses this issue by using getMaybeExpandedExtent in RemoveEmptyPass and during concretization for finding empty tensors.

Fixes #603

@jacobhinkle jacobhinkle requested a review from naoyam July 18, 2023 12:53
@jacobhinkle jacobhinkle marked this pull request as ready for review July 18, 2023 12:55
@jacobhinkle
Copy link
Collaborator Author

!build

@jacobhinkle
Copy link
Collaborator Author

Test failures are unrelated: 1133 on A100 and torchscript test_category_rule.

Copy link
Collaborator

@naoyam naoyam left a comment

Choose a reason for hiding this comment

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

LGTM

@jacobhinkle jacobhinkle merged commit 75cc157 into main Jul 19, 2023
@jacobhinkle jacobhinkle deleted the zero_expanded_extent branch July 19, 2023 00:32
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.

Wrong output shape in broadcast_in_dim with empty inputs

2 participants