From 1dd07d147da4e2011873a9beda17faa78e5ab926 Mon Sep 17 00:00:00 2001 From: Tianlei Wu Date: Thu, 19 Jan 2023 18:20:46 -0800 Subject: [PATCH] fix windows build error (#14362) ### Description Fix https://github.com/microsoft/onnxruntime/issues/14359 test\greedy_search_top_one.cc(21,44): warning C4244: '=': conversion from 'int32_t' to '_Ty', possible loss of data [C:\Users\11000978\onnxruntime\build\Windows\Debug\onnxrunti me_providers_cuda.vcxproj] ### Motivation and Context --- onnxruntime/core/providers/cuda/test/greedy_search_top_one.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxruntime/core/providers/cuda/test/greedy_search_top_one.cc b/onnxruntime/core/providers/cuda/test/greedy_search_top_one.cc index 13c468116f..96282c89ad 100644 --- a/onnxruntime/core/providers/cuda/test/greedy_search_top_one.cc +++ b/onnxruntime/core/providers/cuda/test/greedy_search_top_one.cc @@ -18,7 +18,7 @@ void FillAndShuffle(std::vector& values, int32_t batch_size, int32_t voca std::mt19937 generator(rd()); for (int32_t batch = 0; batch < batch_size; batch++) { for (int32_t vocab = 0; vocab < vocab_size; vocab++) { - values[batch * vocab_size + vocab] = vocab; + values[batch * vocab_size + vocab] = static_cast(vocab); } std::shuffle(values.begin() + batch * vocab_size, values.begin() + batch * vocab_size + vocab_size,