| 628 | } |
| 629 | |
| 630 | std::shared_ptr<DMatrix> GetDMatrixFromData(const std::vector<float>& x, std::size_t num_rows, |
| 631 | bst_feature_t num_columns) { |
| 632 | data::DenseAdapter adapter(x.data(), num_rows, num_columns); |
| 633 | auto p_fmat = std::shared_ptr<DMatrix>( |
| 634 | new data::SimpleDMatrix(&adapter, std::numeric_limits<float>::quiet_NaN(), 1)); |
| 635 | CHECK_EQ(p_fmat->Info().num_row_, num_rows); |
| 636 | CHECK_EQ(p_fmat->Info().num_col_, num_columns); |
| 637 | return p_fmat; |
| 638 | } |
| 639 | |
| 640 | [[nodiscard]] std::shared_ptr<DMatrix> GetExternalMemoryDMatrixFromData( |
| 641 | HostDeviceVector<float> const& x, bst_idx_t n_samples, bst_feature_t n_features, |