Skip to content

Commit f371c15

Browse files
author
yarden-sony
committed
change input names
1 parent 153b9a4 commit f371c15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

model_compression_toolkit/exporter/model_exporter/pytorch/fakely_quant_onnx_pytorch_exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def export(self, output_names=None) -> None:
100100
model_output = self.model(*model_input) if isinstance(model_input, (list, tuple)) else self.model(
101101
model_input)
102102

103-
input_names = [n.name for n in self.model.node_sort if n.type == DummyPlaceHolder]
103+
input_nodes = [n for n in self.model.node_sort if n.type == DummyPlaceHolder]
104+
input_names = [f"input_{i}" for i in range(len(input_nodes))] if len(input_nodes) > 1 else ["input"]
104105
dynamic_axes = {name: {0: 'batch_size'} for name in input_names}
105106
if output_names is None:
106107
# Determine number of outputs and prepare output_names and dynamic_axes
@@ -119,7 +120,6 @@ def export(self, output_names=None) -> None:
119120
f"({output_names}) and model output count "
120121
f"({num_of_outputs}):\n")
121122
dynamic_axes.update({name: {0: 'batch_size'} for name in output_names})
122-
dynamic_axes.update({"input": {0: 'batch_size'}})
123123
if hasattr(self.model, 'metadata'):
124124
onnx_bytes = BytesIO()
125125
torch.onnx.export(self.model,

0 commit comments

Comments
 (0)