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

Function asarray

python-package/xgboost/testing/ordinal.py:44–50  ·  view source on GitHub ↗

Wrapper to get an array.

(device: Device, data: Any)

Source from the content-addressed store, hash-verified

42
43
44def asarray(device: Device, data: Any) -> np.ndarray:
45 """Wrapper to get an array."""
46 if device == "cpu":
47 return np.asarray(data)
48 import cupy as cp
49
50 return cp.asarray(data)
51
52
53def comp_booster(device: Device, Xy: DMatrix, booster: str) -> None:

Callers 3

_basic_exampleFunction · 0.85
run_mixedFunction · 0.85
run_cat_invalidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected