Skip to content

Commit 3aaa97b

Browse files
inisisrajeevsrao
authored andcommitted
onnx-graphsurgeon: fix constant folding bug when input is empty
Signed-off-by: inisis <[email protected]>
1 parent 78245b0 commit 3aaa97b

File tree

1 file changed

+1
-1
lines changed
  • tools/onnx-graphsurgeon/onnx_graphsurgeon/ir

1 file changed

+1
-1
lines changed

tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/graph.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ def is_foldable(node):
668668
return False
669669

670670
def all_tensors_const(tensors):
671-
return all([t.name in graph_constants for t in tensors])
671+
return all([t.name in graph_constants for t in tensors if not t.is_empty()])
672672

673673
if not all_tensors_const(node.inputs):
674674
return False

0 commit comments

Comments
 (0)