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 {