Skip to content

Commit c17de65

Browse files
committed
Add note.
1 parent 63b7695 commit c17de65

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python-package/xgboost/core.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,14 +2187,19 @@ def inplace_predict(
21872187
base_margin: Any = None,
21882188
strict_shape: bool = False,
21892189
) -> NumpyOrCupy:
2190-
"""Run prediction in-place, Unlike :py:meth:`predict` method, inplace prediction
2191-
does not cache the prediction result.
2190+
"""Run prediction in-place when possible, Unlike :py:meth:`predict` method,
2191+
inplace prediction does not cache the prediction result.
21922192
21932193
Calling only ``inplace_predict`` in multiple threads is safe and lock
21942194
free. But the safety does not hold when used in conjunction with other
21952195
methods. E.g. you can't train the booster in one thread and perform
21962196
prediction in the other.
21972197
2198+
.. note::
2199+
2200+
If the device ordinal of the input data doesn't match the one configured for
2201+
the booster, data will be copied to the booster device.
2202+
21982203
.. code-block:: python
21992204
22002205
booster.set_param({"predictor": "gpu_predictor"})

0 commit comments

Comments
 (0)