ConvertVersionPass

class onnxscript.version_converter.ConvertVersionPass(target_version: int, fallback: bool = False)[source]

Convert the model to the specified ONNX opset version.

This pass leverages the onnxscript version converter to convert the model. If the conversion is not supported, it falls back to the onnx C API to convert the model. This pass is in-place.

The pass is an no-op if the c-api fails.

target_version

The target ONNX opset version to convert the model to.

fallback

Whether to fallback to the onnx version converter if the target version is not supported. Default is False.

call(model: Model) PassResult[source]

The main entry point for the pass.