Skip to content

Commit 84d060a

Browse files
authored
XNNPACK: Assert on unsupported pass through tensor args
Differential Revision: D83872407 Pull Request resolved: pytorch#14937
1 parent bf977e0 commit 84d060a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backends/xnnpack/xnnpack_preprocess.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def generate_node_to_external_map(
7171
if node.op == "output":
7272
for output_nodes in node.args:
7373
for output_node in output_nodes:
74+
if output_node in node_to_external_map:
75+
raise RuntimeError(
76+
f"Output node '{output_node}' is already in the inputs. "
77+
"This is likely due to pass through arguments, which are not supported in XNNPACK Delegate."
78+
)
7479
node_to_external_map[output_node] = ExternalMeta(
7580
external_id=len(node_to_external_map),
7681
io_type=XNN_VALUE_FLAG_EXTERNAL_OUTPUT,

0 commit comments

Comments
 (0)