Skip to content

Commit

Permalink
Fix unstable tests when run concurrently (#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntBlo committed May 5, 2024
1 parent 152509c commit f8994e0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/burn-core/src/optim/adagrad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ mod tests {
BinFileRecorder::<FullPrecisionSettings>::default()
.record(
optimizer.to_record(),
std::env::temp_dir().as_path().join("test_optim"),
std::env::temp_dir().as_path().join("test_optim_adagrad"),
)
.unwrap();

Expand Down
2 changes: 1 addition & 1 deletion crates/burn-core/src/optim/adam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ mod tests {
BinFileRecorder::<FullPrecisionSettings>::default()
.record(
optimizer.to_record(),
std::env::temp_dir().as_path().join("test_optim"),
std::env::temp_dir().as_path().join("test_optim_adam"),
)
.unwrap();

Expand Down
5 changes: 4 additions & 1 deletion crates/burn-core/src/optim/adamw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ mod tests {
let _linear = optimizer.step(LEARNING_RATE, linear, grads);
let temp_dir = TempDir::new().unwrap();
BinFileRecorder::<FullPrecisionSettings>::default()
.record(optimizer.to_record(), temp_dir.path().join("test_optim"))
.record(
optimizer.to_record(),
temp_dir.path().join("test_optim_adamw"),
)
.unwrap();

let state_optim_before = optimizer.to_record();
Expand Down
5 changes: 4 additions & 1 deletion crates/burn-core/src/optim/rmsprop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ mod tests {
let _linear = optimizer.step(LEARNING_RATE, linear, grads);
let temp_dir = TempDir::new().unwrap();
BinFileRecorder::<FullPrecisionSettings>::default()
.record(optimizer.to_record(), temp_dir.path().join("test_optim"))
.record(
optimizer.to_record(),
temp_dir.path().join("test_optim_rmsprop"),
)
.unwrap();

let state_optim_before = optimizer.to_record();
Expand Down

0 comments on commit f8994e0

Please sign in to comment.