From cd5e90ec637222c7fcdbf38685f5d55efe8c8b6d Mon Sep 17 00:00:00 2001 From: Aditya Goel Date: Thu, 11 Jan 2024 23:32:43 +0000 Subject: [PATCH] Fix windows warning --- onnxruntime/core/providers/cpu/ml/label_encoder.h | 4 ++-- onnxruntime/test/providers/cpu/ml/label_encoder_test.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/cpu/ml/label_encoder.h b/onnxruntime/core/providers/cpu/ml/label_encoder.h index da2cfdc9fd548..2ca5cdd12ff22 100644 --- a/onnxruntime/core/providers/cpu/ml/label_encoder.h +++ b/onnxruntime/core/providers/cpu/ml/label_encoder.h @@ -216,8 +216,8 @@ class LabelEncoder_4 final : public OpKernel { while (input_iter != input.end()) { const auto found = map_.find(*input_iter); *output_iter = found == map_.end() ? default_value_ : found->second; - output_iter++; - input_iter++; + ++output_iter; + ++input_iter; } return Status::OK(); } diff --git a/onnxruntime/test/providers/cpu/ml/label_encoder_test.cc b/onnxruntime/test/providers/cpu/ml/label_encoder_test.cc index bc98fbf0d5903..63001dd1063ce 100644 --- a/onnxruntime/test/providers/cpu/ml/label_encoder_test.cc +++ b/onnxruntime/test/providers/cpu/ml/label_encoder_test.cc @@ -455,9 +455,9 @@ TEST(LabelEncoder, TensorBasedAttributesOpset4) { TEST(LabelEncoder, NaNsMappedTogetherOpset4) { std::vector dims{1, 6}; - std::vector input{3.14, std::nanf("1"), 2.718, std::nanf("2"), 5.0, -1}; + std::vector input{3.14f, std::nanf("1"), 2.718f, std::nanf("2"), 5.f, -1.f}; std::vector output{"a", "ONNX", "b", "ONNX", "c", "onnxruntime"}; - std::vector key_data{3.14, 2.718, 5.0, std::nanf("3")}; + std::vector key_data{3.14f, 2.718f, 5.0f, std::nanf("3")}; std::vector value_data{"a", "b", "c", "ONNX"}; OpTester test("LabelEncoder", 4, onnxruntime::kMLDomain);