You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: optimum/exporters/onnx/__main__.py
+7
Original file line number
Diff line number
Diff line change
@@ -191,6 +191,7 @@ def main_export(
191
191
library_name: Optional[str] =None,
192
192
legacy: bool=False,
193
193
no_dynamic_axes: bool=False,
194
+
do_constant_folding: bool=True,
194
195
**kwargs_shapes,
195
196
):
196
197
"""
@@ -275,6 +276,8 @@ def main_export(
275
276
Disable the use of position_ids for text-generation models that require it for batched generation. Also enable to export decoder only models in three files (without + with past and the merged model). This argument is introduced for backward compatibility and will be removed in a future release of Optimum.
276
277
no_dynamic_axes (bool, defaults to `False`):
277
278
If True, disables the use of dynamic axes during ONNX export.
279
+
do_constant_folding (bool, defaults to `True`):
280
+
PyTorch-specific argument. If `True`, the PyTorch ONNX export will fold constants into adjacent nodes, if possible.
278
281
**kwargs_shapes (`Dict`):
279
282
Shapes to use during inference. This argument allows to override the default shapes used during the ONNX export.
0 commit comments