File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,14 @@ def parameterize_inputs(inputs, prefix=""):
80
80
parameters = [p .output .get_node () for p in tree .flatten (params )]
81
81
results = [ov_opset .result (r .output ) for r in tree .flatten (outputs )]
82
82
ov_model = ov .Model (results = results , parameters = parameters )
83
- for param in ov_model .inputs :
84
- rank = len (param .get_partial_shape ())
85
- dynamic_shape = ov .PartialShape ([- 1 ] * rank )
86
- param .get_node ().set_partial_shape (dynamic_shape )
83
+ flat_specs = tree .flatten (input_signature )
84
+ for ov_input , spec in zip (ov_model .inputs , flat_specs ):
85
+ # Respect the dynamic axes from the original input signature.
86
+ dynamic_shape_dims = [
87
+ - 1 if dim is None else dim for dim in spec .shape
88
+ ]
89
+ dynamic_shape = ov .PartialShape (dynamic_shape_dims )
90
+ ov_input .get_node ().set_partial_shape (dynamic_shape )
87
91
88
92
elif backend .backend () == "tensorflow" :
89
93
import tempfile
You can’t perform that action at this time.
0 commit comments