mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-20 19:12:24 +00:00
Add length checks to fusion_transpose.py (#17608)
This change adds list length checks to node's inputs in fusion_transpose.py. It bypasses the optimization if not applicable. ### Motivation and Context Unsqueeze in opset (<13) has only one input and cause runtime exceptions.
This commit is contained in:
parent
735df7e2a8
commit
be1e51af2a
1 changed files with 3 additions and 1 deletions
|
|
@ -128,7 +128,9 @@ class FusionInsertTranspose(Fusion):
|
|||
return
|
||||
|
||||
if not (
|
||||
self.model.get_constant_value(unsqueeze_3.input[1]) == 3
|
||||
len(unsqueeze_3.input) == 2
|
||||
and self.model.get_constant_value(unsqueeze_3.input[1]) == 3
|
||||
and len(unsqueeze_2.input) == 2
|
||||
and self.model.get_constant_value(unsqueeze_2.input[1]) == 2
|
||||
and len(self.model.get_children(gemm, input_name_to_nodes)) == 1
|
||||
and len(self.model.get_children(unsqueeze_3, input_name_to_nodes)) == 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue