Skip to content

Commit

Permalink
onnx-graphsurgeon: fix constant folding bug when input is empty
Browse files Browse the repository at this point in the history
Signed-off-by: inisis <[email protected]>
  • Loading branch information
inisis authored and rajeevsrao committed Oct 14, 2023
1 parent 78245b0 commit 3aaa97b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/onnx-graphsurgeon/onnx_graphsurgeon/ir/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def is_foldable(node):
return False

def all_tensors_const(tensors):
return all([t.name in graph_constants for t in tensors])
return all([t.name in graph_constants for t in tensors if not t.is_empty()])

if not all_tensors_const(node.inputs):
return False
Expand Down

0 comments on commit 3aaa97b

Please sign in to comment.