Support column major array. (#6765)

This commit is contained in:
Jiaming Yuan
2021-03-20 05:19:46 +08:00
committed by GitHub
parent f6fe15d11f
commit 4ee8340e79
9 changed files with 181 additions and 151 deletions

View File

@@ -210,9 +210,13 @@ class TestGPUPredict:
cp.testing.assert_allclose(predt_from_array, predt_from_dmatrix)
def predict_df(x):
inplace_predt = booster.inplace_predict(x)
# column major array
inplace_predt = booster.inplace_predict(x.values)
d = xgb.DMatrix(x)
copied_predt = cp.array(booster.predict(d))
assert cp.all(copied_predt == inplace_predt)
inplace_predt = booster.inplace_predict(x)
return cp.all(copied_predt == inplace_predt)
for i in range(10):