Extract optional weight. (#8747)

- Extract optional weight from coommon.h to reduce dependency on this header.
- Add test.
This commit is contained in:
Jiaming Yuan
2023-02-07 03:11:53 +08:00
committed by GitHub
parent 0f37a01dd9
commit 28bb01aa22
10 changed files with 74 additions and 22 deletions

View File

@@ -15,6 +15,7 @@
#include <vector>
#include "../common/math.h"
#include "../common/optional_weight.h" // OptionalWeights
#include "xgboost/host_device_vector.h"
#include "xgboost/linalg.h"
#include "xgboost/metric.h"

View File

@@ -1,21 +1,22 @@
/*!
* Copyright 2021-2022 by XGBoost Contributors
/**
* Copyright 2021-2023 by XGBoost Contributors
*/
#include <thrust/scan.h>
#include <cub/cub.cuh>
#include <algorithm>
#include <cassert>
#include <cub/cub.cuh>
#include <limits>
#include <memory>
#include <utility>
#include <tuple>
#include <utility>
#include "xgboost/span.h"
#include "xgboost/data.h"
#include "auc.h"
#include "../collective/device_communicator.cuh"
#include "../common/optional_weight.h" // OptionalWeights
#include "../common/ranking_utils.cuh"
#include "auc.h"
#include "xgboost/data.h"
#include "xgboost/span.h"
namespace xgboost {
namespace metric {

View File

@@ -14,6 +14,7 @@
#include "../collective/communicator-inl.h"
#include "../common/common.h"
#include "../common/math.h"
#include "../common/optional_weight.h" // OptionalWeights
#include "../common/pseudo_huber.h"
#include "../common/threading_utils.h"
#include "metric_common.h"