diff --git a/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h b/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h index a899b88793ef7..9b24e7a04686b 100644 --- a/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h +++ b/onnxruntime/core/providers/cpu/tensor/upsample_antialias.h @@ -239,14 +239,10 @@ void SetupUpsampleFilterAntiAlias(FilterParamsAntiAlias& p, } float total_weight_inv = total_weight == 0.0f ? 1.f : 1.0f / total_weight; -#ifdef _MSC_VER -#pragma warning(push) +#ifdef _WIN32 #pragma warning(disable : 4189) #endif auto* scale_buffer_int = reinterpret_cast(scale_buffer); -#ifdef _MSC_VER -#pragma warning(pop) -#endif for (x = 0; x < xmax_cut - xmin_cut; x++) { scale_buffer[x] *= total_weight_inv; @@ -255,6 +251,9 @@ void SetupUpsampleFilterAntiAlias(FilterParamsAntiAlias& p, scale_buffer_int[x] = static_cast(std::round(scale_buffer[x] * ConstValue::mag_factor * 2.f)); } } +#ifdef _WIN32 +#pragma warning(default : 4189) +#endif /*for (; x < window_size; x++) { scale_buffer[x] = 0; }*/ @@ -262,6 +261,7 @@ void SetupUpsampleFilterAntiAlias(FilterParamsAntiAlias& p, return window_size; }; + const size_t width_rindex = is_nchw ? 0 : 1; const size_t height_rindex = is_nchw ? 1 : 2; const size_t channel_rindex = is_nchw ? 2 : 2; // only works for trilinear NC(chw)