Skip to content

Commit

Permalink
Suppress GCC warning in TreeEnsembleAggregator (#22062)
Browse files Browse the repository at this point in the history
### 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 <[email protected]>
  • Loading branch information
clementperon authored Sep 12, 2024
1 parent 84f7332 commit 10883d7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,10 @@ class TreeAggregatorMin : public TreeAggregator<InputType, ThresholdType, Output
template <typename InputType, typename ThresholdType, typename OutputType>
class TreeAggregatorMax : public TreeAggregator<InputType, ThresholdType, OutputType> {
public:
TreeAggregatorMax<InputType, ThresholdType, OutputType>(size_t n_trees,
const int64_t& n_targets_or_classes,
POST_EVAL_TRANSFORM post_transform,
const std::vector<ThresholdType>& base_values) : TreeAggregator<InputType, ThresholdType, OutputType>(n_trees, n_targets_or_classes,
post_transform, base_values) {}
TreeAggregatorMax(size_t n_trees,
const int64_t& n_targets_or_classes,
POST_EVAL_TRANSFORM post_transform,
const std::vector<ThresholdType>& base_values) : TreeAggregator<InputType, ThresholdType, OutputType>(n_trees, n_targets_or_classes, post_transform, base_values) {}

// 1 output

Expand Down

0 comments on commit 10883d7

Please sign in to comment.