unilab.training.onnx_export.export_policy_onnx¶
- unilab.training.onnx_export.export_policy_onnx(export_module, onnx_path, export_inputs, *, input_names, output_names=None, opset_version=18)[source]¶
Export
export_moduletoonnx_pathand print the artifact path.- Parameters:
export_module (
Module) – Module traced bytorch.onnx.export.onnx_path (
str) – Destination file path for the exported graph.export_inputs (
tuple[Tensor,...]) – Positional example inputs matchinginput_names.input_names (
list[str]) – ONNX input names, aligned positionally withexport_inputs.output_names (
list[str] |None) – ONNX output names; defaults to["action"].opset_version (
int) – ONNX opset version; defaults to 18. Lower versions fail in the dynamo exporter’s InlinePass: torch’s ONNX function library (e.g.aten_isnanfromtorch.nan_to_num) is emitted at opset 18, and version-converting the model below that leaves a function the inliner rejects as an opset mismatch.
- Return type: