MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / PostprocessInstance

Method PostprocessInstance

paddle/fluid/framework/data_set.cc:1414–1443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412}
1413
1414void 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
1445void MultiSlotDataset::SetCurrentPhase(int current_phase) {
1446 current_phase_ = current_phase;

Callers

nothing calls this directly

Calls 9

GetInstanceFunction · 0.85
shuffleFunction · 0.85
shrink_to_fitMethod · 0.80
LocalShuffleMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
ClearMethod · 0.45
CloseMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected