Implement a general array view. (#7365)

* Replace existing matrix and vector view.

This is to prepare for handling higher dimension data and prediction when we support multi-target models.
This commit is contained in:
Jiaming Yuan
2021-11-05 04:16:11 +08:00
committed by GitHub
parent 232144ca09
commit b06040b6d0
11 changed files with 418 additions and 146 deletions

View File

@@ -400,10 +400,8 @@ void UpdateTree(HostDeviceVector<GradientPair>* gpair, DMatrix* dmat,
hist_maker.Configure(args, &generic_param);
hist_maker.Update(gpair, dmat, {tree});
hist_maker.UpdatePredictionCache(
dmat,
VectorView<float>{
MatrixView<float>(preds, {preds->Size(), 1}, preds->DeviceIdx()), 0});
auto cache = linalg::VectorView<float>{preds->DeviceSpan(), {preds->Size()}, 0};
hist_maker.UpdatePredictionCache(dmat, cache);
}
TEST(GpuHist, UniformSampling) {