From 82dcb34c22e6c10f4cd601e92bf6cf83070819de Mon Sep 17 00:00:00 2001 From: Aditya Goel Date: Sun, 10 Sep 2023 13:19:52 +0100 Subject: [PATCH] Use size_t --- .../core/providers/cpu/ml/tree_ensemble_common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/onnxruntime/core/providers/cpu/ml/tree_ensemble_common.h b/onnxruntime/core/providers/cpu/ml/tree_ensemble_common.h index 83ec009960685..ade6a43a966c3 100644 --- a/onnxruntime/core/providers/cpu/ml/tree_ensemble_common.h +++ b/onnxruntime/core/providers/cpu/ml/tree_ensemble_common.h @@ -87,7 +87,7 @@ class TreeEnsembleCommon : public TreeEnsembleCommonAttributes { void ComputeAgg(concurrency::ThreadPool* ttp, const Tensor* X, Tensor* Y, Tensor* label, const AGG& agg) const; private: - size_t AddNodes(const size_t i, const InlinedVector& cmodes, const InlinedVector& truenode_ids, const InlinedVector& falsenode_ids, const std::vector& nodes_featureids, const std::vector& nodes_values_as_tensor, const std::vector& node_values, const std::vector& nodes_missing_value_tracks_true, std::vector& updated_mapping, int64_t tree_id, const InlinedVector& node_tree_ids); + size_t AddNodes(const size_t i, const InlinedVector& cmodes, const InlinedVector& truenode_ids, const InlinedVector& falsenode_ids, const std::vector& nodes_featureids, const std::vector& nodes_values_as_tensor, const std::vector& node_values, const std::vector& nodes_missing_value_tracks_true, std::vector& updated_mapping, int64_t tree_id, const InlinedVector& node_tree_ids); }; template @@ -215,10 +215,10 @@ Status TreeEnsembleCommon::Init( nodes_.clear(); nodes_.reserve(limit); roots_.clear(); - std::unordered_map node_tree_ids_map; + std::unordered_map node_tree_ids_map; node_tree_ids_map.reserve(limit); - InlinedVector truenode_ids, falsenode_ids; + InlinedVector truenode_ids, falsenode_ids; truenode_ids.reserve(limit); falsenode_ids.reserve(limit); max_feature_id_ = 0; @@ -227,7 +227,7 @@ Status TreeEnsembleCommon::Init( for (i = 0; i < limit; ++i) { TreeNodeElementId node_tree_id{static_cast(nodes_treeids[i]), static_cast(nodes_nodeids[i])}; - auto p = node_tree_ids_map.insert(std::pair(node_tree_id, i)); + auto p = node_tree_ids_map.insert(std::pair(node_tree_id, i)); if (!p.second) { ORT_THROW("Node ", node_tree_id.node_id, " in tree ", node_tree_id.tree_id, " is already there."); } @@ -342,7 +342,7 @@ Status TreeEnsembleCommon::Init( } template -size_t TreeEnsembleCommon::AddNodes(const size_t i, const InlinedVector& cmodes, const InlinedVector& truenode_ids, const InlinedVector& falsenode_ids, const std::vector& nodes_featureids, const std::vector& nodes_values_as_tensor, const std::vector& node_values, const std::vector& nodes_missing_value_tracks_true, std::vector& updated_mapping, int64_t tree_id, const InlinedVector& node_tree_ids) { +size_t TreeEnsembleCommon::AddNodes(const size_t i, const InlinedVector& cmodes, const InlinedVector& truenode_ids, const InlinedVector& falsenode_ids, const std::vector& nodes_featureids, const std::vector& nodes_values_as_tensor, const std::vector& node_values, const std::vector& nodes_missing_value_tracks_true, std::vector& updated_mapping, int64_t tree_id, const InlinedVector& node_tree_ids) { // Validate this index maps to the same tree_id as the one we should be building. if (node_tree_ids[i].tree_id != tree_id) { ORT_THROW("Tree id mismatch. Expected ", tree_id, " but got ", node_tree_ids[i].tree_id, " at position ", i);