MCPcopy Create free account
hub / github.com/dmlc/xgboost / FillGradients

Function FillGradients

tests/cpp/tree/test_quantile_hist.cc:263–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261
262namespace {
263void FillGradients(linalg::Matrix<GradientPair>* gpair) {
264 auto h = gpair->HostView();
265 for (std::size_t row = 0; row < h.Shape(0); ++row) {
266 for (std::size_t target = 0; target < h.Shape(1); ++target) {
267 h(row, target) = GradientPair{1.0f, 0.0f};
268 }
269 }
270}
271
272// Verify partitioner doesn't write past buffer end when doing
273// update on small dataset after large one.

Callers 1

TestPartitionerOverrunFunction · 0.85

Calls 2

ShapeMethod · 0.80
HostViewMethod · 0.45

Tested by

no test coverage detected