Skip to content

Commit

Permalink
Revert "ONNX export tool: output dim sizes only when model is RF"
Browse files Browse the repository at this point in the history
This reverts commit 4785332.

This is unclear to me.
This should not be necessary.
There likely is some other bug somewhere.
  • Loading branch information
albertz committed May 19, 2023
1 parent a3083d8 commit bb40b4c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tools/export_to_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,7 @@ def main():
model_outputs_raw_keys.append(k)
for i, dim in enumerate(v.dims):
if dim.is_batch_dim() or dim.is_dynamic():
# For PyTorch we usually don't have the output dimensions as Dim
# classes available in the final tensor, so we can't call
# mark_as_default_output(shape=(batch_dim, ...)).
# These dimensions are automatically instantiated to actual values when
# the output tensor is passed as parameter to mark_as_default_output
# without any shape. Therefore, we don't add these to the output.
if is_rf_module:
model_outputs_raw_keys.append(f"{k}:size{i}")
model_outputs_raw_keys.append(f"{k}:size{i}")

dynamic_axes = {}
for k, v in list(extern_data.data.items()) + list(model_outputs.data.items()):
Expand Down

0 comments on commit bb40b4c

Please sign in to comment.