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

Function dispatch_proxy_set_data

python-package/xgboost/data.py:1713–1749  ·  view source on GitHub ↗

Dispatch for QuantileDMatrix.

(
    proxy: "_ProxyDMatrix",
    data: DataType,
)

Source from the content-addressed store, hash-verified

1711
1712
1713def dispatch_proxy_set_data(
1714 proxy: "_ProxyDMatrix",
1715 data: DataType,
1716) -> None:
1717 """Dispatch for QuantileDMatrix."""
1718 if (
1719 not _is_cudf_ser(data)
1720 and not _is_pandas_series(data)
1721 and not _is_polars_series(data)
1722 ):
1723 _check_data_shape(data)
1724
1725 if isinstance(data, CudfTransformed):
1726 # pylint: disable=W0212
1727 proxy._ref_data_from_cuda_columnar(data)
1728 return
1729 if _is_cupy_alike(data):
1730 proxy._ref_data_from_cuda_interface(data) # pylint: disable=W0212
1731 return
1732 if _is_dlpack(data):
1733 data = _transform_dlpack(data)
1734 proxy._ref_data_from_cuda_interface(data) # pylint: disable=W0212
1735 return
1736 # Host
1737 if isinstance(data, (ArrowTransformed, PandasTransformed)):
1738 proxy._ref_data_from_columnar(data) # pylint: disable=W0212
1739 return
1740 if _is_np_array_like(data):
1741 _check_data_shape(data)
1742 proxy._ref_data_from_array(data) # pylint: disable=W0212
1743 return
1744 if is_scipy_csr(data):
1745 proxy._ref_data_from_csr(data) # pylint: disable=W0212
1746 return
1747
1748 err = TypeError("Value type is not supported for data iterator:" + str(type(data)))
1749 raise err

Callers 1

input_dataMethod · 0.85

Calls 14

_is_cudf_serFunction · 0.85
_is_pandas_seriesFunction · 0.85
_is_polars_seriesFunction · 0.85
_check_data_shapeFunction · 0.85
_is_cupy_alikeFunction · 0.85
_is_dlpackFunction · 0.85
_transform_dlpackFunction · 0.85
_is_np_array_likeFunction · 0.85
is_scipy_csrFunction · 0.85

Tested by

no test coverage detected