Skip to content

Commit 10883d7

Browse files
authored
Suppress GCC warning in TreeEnsembleAggregator (microsoft#22062)
### Description When building with GCC 14.2.1, I got the following warning: onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h:329:59: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor] Remove template parameters from the constructor: The constructor TreeAggregatorMax<InputType, ThresholdType, OutputType> has been simplified to TreeAggregatorMax, because the compiler already knows the template parameters from the class definition. ### Motivation and Context Fix the build issue Signed-off-by: Clément Péron <peron.clem@gmail.com>
1 parent 84f7332 commit 10883d7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,10 @@ class TreeAggregatorMin : public TreeAggregator<InputType, ThresholdType, Output
328328
template <typename InputType, typename ThresholdType, typename OutputType>
329329
class TreeAggregatorMax : public TreeAggregator<InputType, ThresholdType, OutputType> {
330330
public:
331-
TreeAggregatorMax<InputType, ThresholdType, OutputType>(size_t n_trees,
332-
const int64_t& n_targets_or_classes,
333-
POST_EVAL_TRANSFORM post_transform,
334-
const std::vector<ThresholdType>& base_values) : TreeAggregator<InputType, ThresholdType, OutputType>(n_trees, n_targets_or_classes,
335-
post_transform, base_values) {}
331+
TreeAggregatorMax(size_t n_trees,
332+
const int64_t& n_targets_or_classes,
333+
POST_EVAL_TRANSFORM post_transform,
334+
const std::vector<ThresholdType>& base_values) : TreeAggregator<InputType, ThresholdType, OutputType>(n_trees, n_targets_or_classes, post_transform, base_values) {}
336335

337336
// 1 output
338337

0 commit comments

Comments
 (0)