-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for registring custom op libraries #68
base: master
Are you sure you want to change the base?
Conversation
…rom a tensor This is some prep work for string output types and tensor types that vary across the model outputs. For now, the supported types are just the basic numeric types. Since strings have to be copied out of a tensor, it only makes sense to have `String` be an output type, not `str`, hence the new type so that we can have more input types supported than output types.
Outputs aren't all the same type for a single model, so this allows extracting different types per tensor.
@@ -0,0 +1,118 @@ | |||
# onnxruntime requires execinfo.h to build, which only works on glibc-based systems, so alpine is out... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dockerfile sets up onnxruntime and ort-customops so that the "regex" model can run. Not sure how best to integrate this into CI.
#[cfg(windows)] | ||
fn close_lib_handle(handle: *mut ::std::os::raw::c_void) { | ||
unsafe { | ||
winapi::um::libloaderapi::FreeLibrary(handle as winapi::shared::minwindef::HINSTANCE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this works but it does at least compile on windows.
668a0d3
to
e69e125
Compare
This approach allocates owned Strings for each element, which works, but stresses the allocator, and incurs unnecessary copying. Part of the complication stems from the limitation that in Rust, a field can't be a reference to another field in the same struct. This means that having a Vec<u8> of copied data, referred to by a Vec<&str>, which is then referred to by an ArrayView, requires a sequence of 3 structs to express. Building a Vec<String> gets rid of the references, but also loses the efficiency of 1 allocation with strs pointing into it.
This approach allocates owned Strings for each element, which works, but stresses the allocator, and incurs unnecessary copying. Part of the complication stems from the limitation that in Rust, a field can't be a reference to another field in the same struct. This means that having a Vec<u8> of copied data, referred to by a Vec<&str>, which is then referred to by an ArrayView, requires a sequence of 3 structs to express. Building a Vec<String> gets rid of the references, but also loses the efficiency of 1 allocation with strs pointing into it.
e69e125
to
6cf6d0e
Compare
Codecov Report
@@ Coverage Diff @@
## master #68 +/- ##
===========================================
+ Coverage 14.58% 43.29% +28.71%
===========================================
Files 18 19 +1
Lines 960 1111 +151
===========================================
+ Hits 140 481 +341
+ Misses 820 630 -190
Continue to review full report at Codecov.
|
Based on #67.