-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: remove redundant error checks; more useful downcast messages
Many of the ORT APIs are hardcoded to actually *never* return a failure status, despite returning `*mut OrtStatus`, probably for consistency (which is appreciated!) For `ort`, this means almost every API requires a ? or unwrap, even if it will never fail. Notably, this includes all functions on `MemoryInfo`. This commit makes many of these functions return `T` instead of `Result<T>`. Additionally, I found that all of the `downcast` methods on `Value` just panic if the type is not downcastable - that's bad! Now a nice `Display` is implemented for `ValueType`, and the downcast functions actually return errors. Extraction methods also have better error messages. Also in this commit: checking if memory is CPU accessible the *correct* way instead of matching AllocationDevices.
- Loading branch information
1 parent
b9ef6aa
commit 359a051
Showing
11 changed files
with
275 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.