Skip to content

Commit 9a6b75b

Browse files
committed
fix issue with duplicate inputs
1 parent c4c187a commit 9a6b75b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

exir/passes/prune_empty_tensors_pass.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
# pyre-strict
8+
from typing import cast, List
89

910
import torch
1011
from executorch.exir.dialects._ops import ops as exir_ops
@@ -30,7 +31,7 @@ def remove_empty_tensors_from_cat(
3031
"""
3132
Removes empty tensors from the graph that are inputs to aten.cat.default
3233
"""
33-
concat_list = cat_node.all_input_nodes
34+
concat_list = cast(List[Node], cat_node.args[0])
3435
pruned_concat_list = []
3536
for input_arg in concat_list:
3637
input_arg_tensor = input_arg.meta["val"]

0 commit comments

Comments
 (0)