Add exporter utils for model exporting (currently only implemented for PyTorch) #410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Hi there! Thanks for keeping skrl so useful—really appreciate the work here. This PR introduces a lightweight PyTorch exporter utility so policies can be packaged for deployment as TorchScript or ONNX. The helper
_TorchPolicyExporterwraps a policy together with optional observation and state preprocessors, exposing a simpleforward(observations, states) -> actionsinterface for inference. Two user-facing entry points live inexporter.py:export_policy_as_jitto export TorchScript andexport_policy_as_onnxto export ONNX, both handling tracing/export inputs, dummy fallbacks, device handling, and optional optimization toggles.Some limitations:
exportermodule.Glad to have more discussions on this PR.