remove reserve for more aggressive memory generation
This commit is contained in:
parent
46be6181b5
commit
724eda2435
@ -41,7 +41,6 @@ void SimpleCSRSource::CopyFrom(dmlc::Parser<uint32_t>* parser) {
|
|||||||
if (batch.weight != nullptr) {
|
if (batch.weight != nullptr) {
|
||||||
info.weights.insert(info.weights.end(), batch.weight, batch.weight + batch.size);
|
info.weights.insert(info.weights.end(), batch.weight, batch.weight + batch.size);
|
||||||
}
|
}
|
||||||
row_data_.reserve(row_data_.size() + batch.offset[batch.size] - batch.offset[0]);
|
|
||||||
CHECK(batch.index != nullptr);
|
CHECK(batch.index != nullptr);
|
||||||
// update information
|
// update information
|
||||||
this->info.num_row += batch.size;
|
this->info.num_row += batch.size;
|
||||||
@ -54,9 +53,8 @@ void SimpleCSRSource::CopyFrom(dmlc::Parser<uint32_t>* parser) {
|
|||||||
static_cast<uint64_t>(index + 1));
|
static_cast<uint64_t>(index + 1));
|
||||||
}
|
}
|
||||||
size_t top = row_ptr_.size();
|
size_t top = row_ptr_.size();
|
||||||
row_ptr_.resize(top + batch.size);
|
|
||||||
for (size_t i = 0; i < batch.size; ++i) {
|
for (size_t i = 0; i < batch.size; ++i) {
|
||||||
row_ptr_[top + i] = row_ptr_[top - 1] + batch.offset[i + 1] - batch.offset[0];
|
row_ptr_.push_back(row_ptr_[top - 1] + batch.offset[i + 1] - batch.offset[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->info.num_nonzero = static_cast<uint64_t>(row_data_.size());
|
this->info.num_nonzero = static_cast<uint64_t>(row_data_.size());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user