Skip to content

Commit

Permalink
export weights as a constants in graph, so can do constant folding to…
Browse files Browse the repository at this point in the history
… them
  • Loading branch information
zhijxu-MS committed Jan 26, 2024
1 parent 656ca66 commit b70cd75
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def _get_exported_model(self, input_schema: ORTModelInputOutputSchemaType, *inpu
"training": self._export_mode,
"dynamic_axes": self._input_info.dynamic_axes,
"verbose": torch_exporter_verbose_log,
"export_params": False,
"export_params": False if self._export_mode != torch.onnx.TrainingMode.EVAL else True,

Check warning

Code scanning / lintrunner

RUFF/SIM211 Warning

Use not ... instead of False if ... else True.
See https://docs.astral.sh/ruff/rules/if-expr-with-false-true
"keep_initializers_as_inputs": True,
}

Expand Down

0 comments on commit b70cd75

Please sign in to comment.