mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Change RuntimeError to ImportError (#17380)
The `onnxruntime-validation` for ORTModule checks for `ImportError`:
44101e8771/onnxruntime/python/onnxruntime_validation.py (L73-L75)
If any other kind of error is raised, it does not silently fail and will
raise an exception. This causes a problem when ortmodule is explicitly
not made available on win/mac packages since we currently raise a
RuntimeError.
Resolves issue:
https://github.com/microsoft/onnxruntime-training-examples/issues/161
This commit is contained in:
parent
16cfcd0590
commit
8b98ecad70
1 changed files with 1 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ from ._fallback import ORTModuleFallbackException, ORTModuleInitException, _Fall
|
|||
from .torch_cpp_extensions import is_installed as is_torch_cpp_extensions_installed
|
||||
|
||||
if not is_ortmodule_available():
|
||||
raise RuntimeError("ORTModule is not supported on this platform.")
|
||||
raise ImportError("ORTModule is not supported on this platform.")
|
||||
|
||||
|
||||
def _defined_from_envvar(name, default_value, warn=True):
|
||||
|
|
|
|||
Loading…
Reference in a new issue