@@ -227,8 +227,8 @@ void build_graph(it_lab_ai::Graph& graph, it_lab_ai::Tensor& input,
227227 try {
228228 std::sort (connection_list.begin (), connection_list.end (),
229229 [&](const auto & a, const auto & b) {
230- if (!name_to_layer_ptr.count (a.first ) ||
231- !name_to_layer_ptr.count (b.first )) {
230+ if (!name_to_layer_ptr.contains (a.first ) ||
231+ !name_to_layer_ptr.contains (b.first )) {
232232 return false ;
233233 }
234234 return name_to_layer_ptr[a.first ]->getID () <
@@ -239,8 +239,8 @@ void build_graph(it_lab_ai::Graph& graph, it_lab_ai::Tensor& input,
239239 }
240240
241241 for (const auto & [source_name, target_name] : connection_list) {
242- if (name_to_layer_ptr.count (source_name) &&
243- name_to_layer_ptr.count (target_name)) {
242+ if (name_to_layer_ptr.contains (source_name) &&
243+ name_to_layer_ptr.contains (target_name)) {
244244 if (target_name.find (" Concat" ) != std::string::npos ||
245245 name_to_layer_ptr[target_name]->getName () == it_lab_ai::kConcat ) {
246246 if (concat_connections.find (target_name) != concat_connections.end ()) {
@@ -573,7 +573,7 @@ ParseResult parse_json_model(RuntimeOptions options,
573573 std::string constant_name = inputs[1 ].get <std::string>();
574574 constant_name = get_base_layer_name (constant_name);
575575
576- if (layer_parameters.count (constant_name)) {
576+ if (layer_parameters.contains (constant_name)) {
577577 splits = layer_parameters[constant_name];
578578 } else if (constant_name.find (" onnx::" ) != std::string::npos) {
579579 splits = last_constant_value;
@@ -771,7 +771,7 @@ ParseResult parse_json_model(RuntimeOptions options,
771771 std::string constant_name = inputs[1 ].get <std::string>();
772772 constant_name = get_base_layer_name (constant_name);
773773
774- if (layer_parameters.count (constant_name)) {
774+ if (layer_parameters.contains (constant_name)) {
775775 shape = layer_parameters[constant_name];
776776 }
777777 }
@@ -833,7 +833,7 @@ ParseResult parse_json_model(RuntimeOptions options,
833833 std::string constant_name = inputs[1 ].get <std::string>();
834834 constant_name = get_base_layer_name (constant_name);
835835
836- if (layer_parameters.count (constant_name)) {
836+ if (layer_parameters.contains (constant_name)) {
837837 axes = layer_parameters[constant_name];
838838 } else if (constant_name.find (" onnx::" ) != std::string::npos) {
839839 axes = last_constant_value;
0 commit comments