mirror of
https://github.com/tracel-ai/burn.git
synced 2026-05-31 19:49:48 +09:00
Ignore local tests with pre-trained weights (#4676)
* Ignore local tests with pre-trained weights * Fix clippy
This commit is contained in:
committed by
GitHub
parent
1fd8cff2af
commit
5466db71bf
@@ -26,9 +26,6 @@ doc = [
|
||||
"pretrained",
|
||||
]
|
||||
pretrained = ["std", "burn-store/pytorch", "burn-std/network", "dirs"]
|
||||
# Added for some test cases that should only be run locally
|
||||
# (e.g., test cases with pretrained weights for gram matrix loss)
|
||||
test-local = []
|
||||
std = [
|
||||
"burn-core/std",
|
||||
"num-traits/std",
|
||||
|
||||
@@ -313,6 +313,9 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
// TODO: run tests only locally, and #[serial]'ised?
|
||||
// #[cfg(feature = "test-local")]
|
||||
#[ignore = "downloads pre-trained weights"]
|
||||
fn test_gram_matrix_loss_config_valid_weights() {
|
||||
let device = Default::default();
|
||||
let layer_weights = vec![0.0, 0.2, 0.2, 0.25, 0.4];
|
||||
@@ -511,7 +514,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "test-local")]
|
||||
#[ignore = "downloads pre-trained weights"]
|
||||
fn test_gram_matrix_loss_pretrained_weights_identical_inputs() {
|
||||
let device = Default::default();
|
||||
let loss_fn =
|
||||
@@ -532,7 +535,7 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "test-local")]
|
||||
#[ignore = "downloads pre-trained weights"]
|
||||
fn test_gram_matrix_loss_pretrained_weights_different_inputs() {
|
||||
let device = Default::default();
|
||||
let loss_fn =
|
||||
|
||||
@@ -285,17 +285,16 @@ pub(crate) fn handle_command(
|
||||
)?;
|
||||
|
||||
// burn-nn (pretrained and local tests)
|
||||
let mut nn_features = "pretrained".to_string();
|
||||
// If the "CI" environment variable is missing, we are running locally.
|
||||
if std::env::var("CI").is_err() {
|
||||
nn_features.push_str(",test-local");
|
||||
}
|
||||
// if std::env::var("CI").is_err() {
|
||||
// nn_features.push_str(",test-local");
|
||||
// }
|
||||
helpers::custom_crates_tests(
|
||||
vec!["burn-nn"],
|
||||
handle_test_args(&["--features", &nn_features], args.release),
|
||||
handle_test_args(&["--features", "pretrained"], args.release),
|
||||
None,
|
||||
None,
|
||||
&format!("std burn-nn with features: {}", nn_features),
|
||||
"std burn-nn",
|
||||
)?;
|
||||
}
|
||||
CiTestType::GcpCudaRunner => (),
|
||||
|
||||
Reference in New Issue
Block a user