Skip to content

Commit ff46529

Browse files
committed
mypy
1 parent 4ae0f2c commit ff46529

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

onnx_diagnostic/export/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def method_to_onnx(
479479
custom loops (see :func:`onnx_diagnostic.export.control_flow_onnx.loop_for_onnx`)
480480
:param onnx_plugs: the code was modified to replace some parts with onnx translation
481481
:param inline: inline local functions
482-
:param convert_after_n_calls: convets the model after this number of calls.
482+
:param convert_after_n_calls: converts the model after this number of calls.
483483
:param patch_kwargs: patch arguments
484484
:return: the output of the selected exporter, usually a structure including
485485
an onnx model

onnx_diagnostic/export/dynamic_shapes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ def guess_dynamic_shapes(self, auto: Union[bool, str] = False) -> DYNAMIC_SHAPES
10001000
msg=lambda name=name: f" failing input {name!r}",
10011001
)
10021002
# reordering
1003-
if kwargs is not None:
1003+
if kwargs is not None and self.forward_ordered_parameter_names:
10041004
kwargs = {
10051005
p: kwargs[p] for p in self.forward_ordered_parameter_names if p in kwargs
10061006
}
@@ -1066,11 +1066,11 @@ def move_to_kwargs(
10661066
f"and kwargs={set(kwargs)}, "
10671067
f"forward_ordered_parameter_names={self.forward_ordered_parameter_names}"
10681068
)
1069-
if kwargs is not None:
1069+
if kwargs is not None and self.forward_ordered_parameter_names:
10701070
kwargs = {
10711071
p: kwargs[p] for p in self.forward_ordered_parameter_names if p in kwargs
10721072
}
1073-
if kw_dyn is not None:
1073+
if kw_dyn is not None and self.forward_ordered_parameter_names:
10741074
kw_dyn = {
10751075
p: kw_dyn[p] for p in self.forward_ordered_parameter_names if p in kw_dyn
10761076
}

0 commit comments

Comments
 (0)