latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
tensorplay.onnx.export
- tensorplay.onnx.export(exported_program: ExportedProgram | Any, f: Any = None, *, input_names: Sequence[str] | None = None, output_names: Sequence[str] | None = None, opset_version: int | None = None, dynamic_axes: Mapping[str, Mapping[int, str] | Sequence[int]] | None = None, do_constant_folding: bool = True, verify: bool = False, rtol: float = 0.0001, atol: float = 1e-05, external_data: bool | None = None, external_data_location: str | None = None, check_model: bool = True) Any[source]
Export a TensorPlay model to ONNX.
- Parameters:
exported_program – an
ExportedProgram, or a(model, *args, kwargs)sequence captured on the fly.f – file path or writable binary file object. When omitted the
ModelProtois returned instead of being written.input_names – names for the graph inputs, in placeholder order.
output_names – names for the graph outputs.
opset_version – target ONNX opset (default 18, minimum 13).
dynamic_axes –
{value_name: {axis: axis_name}}(or a list of axis indices) marking dimensions that vary at runtime. Applies to both inputs and outputs.do_constant_folding – fold subgraphs whose inputs are all constants.
verify – run the exported model under onnxruntime and compare against eager execution of
exported_program.rtol/atol – tolerances used by
verify.external_data – store initializers in a side-car file.
Nonedecides from the model size (models at or above the 2 GiB protobuf limit).external_data_location – side-car file name for
external_data.check_model – run
onnx.checkerover the finished model.
- Returns:
The
onnx.ModelProtowhenfisNone, elseNone.
Help improve this page
Found an error, an unclear step, or a missing example?

