| 1412 | } |
| 1413 | |
| 1414 | void MultiSlotDataset::PostprocessInstance() { |
| 1415 | // divide pv instance, and merge to input_channel_ |
| 1416 | if (enable_pv_merge_) { |
| 1417 | auto fleet_ptr = framework::FleetWrapper::GetInstance(); |
| 1418 | std::shuffle(input_records_.begin(), |
| 1419 | input_records_.end(), |
| 1420 | fleet_ptr->LocalRandomEngine()); |
| 1421 | input_channel_->Open(); |
| 1422 | input_channel_->Write(std::move(input_records_)); |
| 1423 | for (auto& pv_consume : multi_pv_consume_) { |
| 1424 | pv_consume->Clear(); |
| 1425 | } |
| 1426 | input_channel_->Close(); |
| 1427 | input_records_.clear(); |
| 1428 | input_records_.shrink_to_fit(); |
| 1429 | } else { |
| 1430 | input_channel_->Open(); |
| 1431 | for (auto& consume_channel : multi_consume_channel_) { |
| 1432 | std::vector<Record> ins_data; |
| 1433 | consume_channel->Close(); |
| 1434 | consume_channel->ReadAll(ins_data); |
| 1435 | input_channel_->Write(std::move(ins_data)); |
| 1436 | ins_data.clear(); |
| 1437 | ins_data.shrink_to_fit(); |
| 1438 | consume_channel->Clear(); |
| 1439 | } |
| 1440 | input_channel_->Close(); |
| 1441 | this->LocalShuffle(); |
| 1442 | } |
| 1443 | } |
| 1444 | |
| 1445 | void MultiSlotDataset::SetCurrentPhase(int current_phase) { |
| 1446 | current_phase_ = current_phase; |
nothing calls this directly
no test coverage detected