mirror of
https://github.com/pykeio/ort
synced 2026-04-25 16:34:55 +02:00
test: create session so env is initialized
This commit is contained in:
@@ -6,7 +6,10 @@ use std::{
|
||||
thread::{self, JoinHandle}
|
||||
};
|
||||
|
||||
use ort::environment::{GlobalThreadPoolOptions, ThreadManager, ThreadWorker};
|
||||
use ort::{
|
||||
environment::{GlobalThreadPoolOptions, ThreadManager, ThreadWorker},
|
||||
session::Session
|
||||
};
|
||||
|
||||
struct ThreadStats {
|
||||
active_threads: AtomicUsize
|
||||
@@ -64,6 +67,8 @@ fn global_thread_manager() -> ort::Result<()> {
|
||||
)
|
||||
.commit();
|
||||
|
||||
let _session = Session::builder()?.commit_from_file("tests/data/upsample.ort")?;
|
||||
|
||||
assert_eq!(stats.active_threads.load(Ordering::Acquire), 4);
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user