File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1526,13 +1526,16 @@ def _export(
1526
1526
1527
1527
# torch.onnx.export does not support opset versions >=18
1528
1528
if opset_version > _constants .ONNX_TORCHSCRIPT_EXPORTER_MAX_OPSET :
1529
- raise ValueError (
1529
+ # We do not want to fail because we should still allow users to create
1530
+ # custom symbolic functions for opset>17
1531
+ warnings .warn (
1530
1532
f"Exporting to ONNX opset version { opset_version } is not supported. "
1531
1533
f"by 'torch.onnx.export()'. "
1532
1534
f"The highest opset version supported is { _constants .ONNX_TORCHSCRIPT_EXPORTER_MAX_OPSET } . "
1533
1535
f"To use a newer opset version, consider 'torch.onnx.dynamo_export()'. "
1534
1536
f"Note that dynamo_export() is in preview. Please report errors with "
1535
- f"dynamo_export() as Github issues to https://github.com/pytorch/pytorch/issues."
1537
+ f"dynamo_export() as Github issues to https://github.com/pytorch/pytorch/issues." ,
1538
+ category = errors .OnnxExporterWarning ,
1536
1539
)
1537
1540
1538
1541
if export_modules_as_functions and opset_version < 15 :
You can’t perform that action at this time.
D33
0 commit comments