make available_providers function

This commit is contained in:
Andrey Tkachenko 2021-01-22 14:58:21 +04:00
parent 4f6be5efb9
commit 7a6101bee7
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ fn main() -> Result<()> {
let so = SessionOptions::new()?;
println!("Available Providers: {:?}", so.available_providers());
println!("Available Providers: {:?}", SessionOptions::available_providers());
for path in &opt.onnx {
println!("model {:?}", path);

View File

@ -161,7 +161,7 @@ impl SessionOptions {
Ok(SessionOptions { raw })
}
pub fn available_providers(&self) -> Vec<String> {
pub fn available_providers() -> Vec<String> {
let mut providers_array: *mut *mut i8 = std::ptr::null_mut();
let mut providers_len: i32 = 0;