From 7a6101bee726cf29122d593b439cb1a1a2dd2c55 Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Fri, 22 Jan 2021 14:58:21 +0400 Subject: [PATCH] make available_providers function --- examples/info.rs | 2 +- src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/info.rs b/examples/info.rs index 578ffae..66bd151 100644 --- a/examples/info.rs +++ b/examples/info.rs @@ -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); diff --git a/src/lib.rs b/src/lib.rs index cbafd1c..c5974e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,8 +160,8 @@ impl SessionOptions { let raw = call!(@unsafe @ptr CreateSessionOptions)?; Ok(SessionOptions { raw }) } - - pub fn available_providers(&self) -> Vec { + + pub fn available_providers() -> Vec { let mut providers_array: *mut *mut i8 = std::ptr::null_mut(); let mut providers_len: i32 = 0; @@ -178,7 +178,7 @@ impl SessionOptions { res } - + pub fn add_cpu(&self, use_arena: bool) { let so = self.raw; let status = unsafe {