Skip to content

Commit

Permalink
Suppress GCC warning in TreeEnsembleAggregator
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Clément Péron <[email protected]>
  • Loading branch information
clementperon committed Sep 11, 2024
1 parent 91c916f commit b57f3e8
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) {}

Check warning on line 334 in onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h

View workflow job for this annotation

GitHub Actions / Optional Lint C++

[cpplint] reported by reviewdog 🐶 Lines should be <= 120 characters long [whitespace/line_length] [2] Raw Output: onnxruntime/core/providers/cpu/ml/tree_ensemble_aggregator.h:334: Lines should be <= 120 characters long [whitespace/line_length] [2]

// 1 output

Expand Down

0 comments on commit b57f3e8

Please sign in to comment.