Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
shu5620 committed Aug 22, 2023
1 parent fbeb4b1 commit 438afb1
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions border-async-trainer/src/async_trainer/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ where
loop {
// Update replay buffer
let msgs = msg_reciever.get_messages();
println!("msgs.len(): {}", msgs.len());
msgs.into_iter().for_each(|msg| {
samples += msg.pushed_items.len();
samples_total += msg.pushed_items.len();
Expand Down Expand Up @@ -410,18 +411,9 @@ where
receiver: Receiver<PushedItemMessage<R::PushedItem>>,
stop: Arc<Mutex<bool>>,
) {
loop {
// Handle incoming message
// TODO: error handling, timeout
// TODO: caching
// TODO: stats
println!("aaa");
*msgs.lock().unwrap() = receiver.iter().collect();

// Stop the loop
if *stop.lock().unwrap() {
break;
}
println!("aaa");
for msg in receiver.iter() {
msgs.lock().unwrap().push(msg);
}

println!("ccc");
Expand Down

0 comments on commit 438afb1

Please sign in to comment.