Skip to content

Commit c79aca7

Browse files
committed
Address review: fix comment wording and extend test coverage
- Change 'may fail' to 'does not detect' (torchgen structurally cannot handle ListType alias annotations) - Add split_with_sizes.default to test to document overlap with blocklist Signed-off-by: Lidang-Jiang <lidangjiang@gmail.com>
1 parent 4330ac2 commit c79aca7

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

exir/program/_program.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,9 @@ def keep(op):
11221122
)
11231123
return False
11241124

1125-
# Fallback: torchgen may fail to detect alias annotations on ops
1126-
# returning lists of tensors (e.g. split.Tensor returns Tensor(a)[]).
1127-
# Check op._schema.returns directly as a more reliable source.
1125+
# Fallback: torchgen does not detect alias annotations on ops
1126+
# returning lists of aliased tensors (e.g. split.Tensor returns
1127+
# Tensor(a)[]). Check op._schema.returns directly.
11281128
for ret in schema.returns:
11291129
if ret.alias_info is not None:
11301130
log_warning(

exir/tests/test_passes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ def test_remove_invalid_ops_filters_aliased_list_returns(self) -> None:
957957
torch.ops.aten.split.Tensor,
958958
torch.ops.aten.chunk.default,
959959
torch.ops.aten.tensor_split.sections,
960+
torch.ops.aten.split_with_sizes.default,
960961
]
961962
for op in aliased_list_ops:
962963
result = _remove_invalid_ops_for_not_decompose([op])

0 commit comments

Comments
 (0)