Extract JSON utils. (#9645)

This commit is contained in:
Jiaming Yuan
2023-10-10 07:15:14 +08:00
committed by GitHub
parent 4e5a7729c3
commit 680d53db43
6 changed files with 90 additions and 75 deletions

View File

@@ -1,19 +1,19 @@
/**
* Copyright 2023 by XGBoost contributors
* Copyright 2023, XGBoost contributors
*/
#include "quantile_loss_utils.h"
#include <cctype> // std::isspace
#include <istream> // std::istream
#include <ostream> // std::ostream
#include <string> // std::string
#include <vector> // std::vector
#include <cctype> // for isspace
#include <istream> // for istream
#include <ostream> // for ostream
#include <string> // for string
#include <vector> // for vector
#include "xgboost/json.h" // F32Array,TypeCheck,get,Number
#include "xgboost/json_io.h" // JsonWriter
#include "../common/json_utils.h" // for TypeCheck
#include "xgboost/json.h" // for F32Array, get, Number
#include "xgboost/json_io.h" // for JsonWriter
namespace xgboost {
namespace common {
namespace xgboost::common {
std::ostream& operator<<(std::ostream& os, const ParamFloatArray& array) {
auto const& t = array.Get();
xgboost::F32Array arr{t.size()};
@@ -70,5 +70,4 @@ std::istream& operator>>(std::istream& is, ParamFloatArray& array) {
}
DMLC_REGISTER_PARAMETER(QuantileLossParam);
} // namespace common
} // namespace xgboost
} // namespace xgboost::common