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

Method GenerateColumnarArrayInterface

tests/cpp/helpers.cc:339–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339std::string RandomDataGenerator::GenerateColumnarArrayInterface(
340 std::vector<HostDeviceVector<float>>* data) const {
341 CHECK(data);
342 CHECK_EQ(data->size(), cols_);
343 auto& storage = *data;
344 Json arr{Array()};
345 for (size_t i = 0; i < cols_; ++i) {
346 auto column = this->ArrayInterfaceImpl(&storage[i], rows_, 1);
347 get<Array>(arr).emplace_back(column);
348 }
349 std::string out;
350 Json::Dump(arr, &out);
351 return out;
352}
353
354void RandomDataGenerator::GenerateCSR(HostDeviceVector<float>* value,
355 HostDeviceVector<std::size_t>* row_ptr,

Callers

nothing calls this directly

Calls 3

ArrayInterfaceImplMethod · 0.95
ArrayClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected