Use view for SparsePage exclusively. (#6590)
This commit is contained in:
@@ -176,9 +176,10 @@ inline void ValidateCuts(const HistogramCuts& cuts, DMatrix* dmat,
|
||||
// Collect data into columns
|
||||
std::vector<std::vector<float>> columns(dmat->Info().num_col_);
|
||||
for (auto& batch : dmat->GetBatches<SparsePage>()) {
|
||||
auto page = batch.GetView();
|
||||
ASSERT_GT(batch.Size(), 0ul);
|
||||
for (auto i = 0ull; i < batch.Size(); i++) {
|
||||
for (auto e : batch[i]) {
|
||||
for (auto e : page[i]) {
|
||||
columns[e.index].push_back(e.fvalue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user