Skip to content

Commit

Permalink
fix(test): Fix all warnings with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
uttarayan21 committed Oct 2, 2024
1 parent 488e2e5 commit f47b79b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ fn test_basic_metal() {
fn test_basic_opencl() -> Result<(), Box<dyn std::error::Error>> {
let backend = ForwardType::OpenCL;
let realesr = std::path::Path::new("tests/assets/realesr.mnn");
use mnn::BackendConfig;

let mut net = mnn::Interpreter::from_file(realesr)?;
net.set_cache_file(realesr.with_extension("cache"), 128)?;
Expand Down
2 changes: 0 additions & 2 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ impl AsRef<[u8]> for Model {
}

pub fn test_basic(backend: ForwardType) -> Result<()> {
use mnn::BackendConfig;

let mut net = mnn::Interpreter::from_file("tests/assets/realesr.mnn")?;
let mut config = ScheduleConfig::new();
config.set_type(backend);
Expand Down
3 changes: 1 addition & 2 deletions tests/segfault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ use mnn::*;
fn test_segfault_case_1_() -> Result<(), Box<dyn std::error::Error>> {
let backend = ForwardType::OpenCL;
let realesr = std::path::Path::new("tests/assets/realesr.mnn");
use mnn::BackendConfig;

let mut net = mnn::Interpreter::from_file(realesr)?;
net.set_cache_file(realesr.with_extension("cache"), 128)?;
let mut config = ScheduleConfig::new();
config.set_type(backend);
let mut session = net.create_session(config)?;
net.update_cache_file(&mut session);
net.update_cache_file(&mut session)?;

net.inputs(&session).iter().for_each(|x| {
let mut tensor = x.tensor::<f32>().expect("No tensor");
Expand Down

0 comments on commit f47b79b

Please sign in to comment.