File tree Expand file tree Collapse file tree
onnxruntime/core/providers/cpu/nn Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44#pragma once
55
6- #include < climits >
6+ #include < limits >
77
88#include " core/common/common.h"
99#include " core/framework/op_kernel.h"
@@ -194,10 +194,10 @@ inline Status DeformConvValidateAndParse(
194194 params.out_w = (params.W_in + params.pad_w + params.pad_w_end - params.dilation_w * (params.kW - 1 ) - 1 ) / params.stride_w + 1 ;
195195 ORT_RETURN_IF_NOT (params.out_h >= 0 && params.out_w >= 0 , " Computed output spatial size must be non-negative." );
196196
197- // CPU BilinearInterpolate uses int for indices (for performance optimization); W <= INT_MAX / (H+1) covers all index math.
197+ // CPU BilinearInterpolate uses int for indices (for performance optimization); W <= int_max / (H+1) covers all index math.
198198 ORT_RETURN_IF_NOT (params.H >= 0 && params.W_in >= 0 , " Input spatial dimensions H and W must be non-negative." );
199- ORT_RETURN_IF_NOT (params.W_in <= static_cast <int64_t >(INT_MAX ) / (params.H + 1 ),
200- " Input (H+1)*W must not exceed INT_MAX (for performance optimization)." );
199+ ORT_RETURN_IF_NOT (params.W_in <= static_cast <int64_t >(std::numeric_limits< int >:: max () ) / (params.H + 1 ),
200+ " Input (H+1)*W must not exceed int max (for performance optimization)." );
201201
202202 // Validate tensor shapes (use division to avoid int64 overflow in offset_group * 2 * kH * kW).
203203 ORT_RETURN_IF_NOT (offset_shape[0 ] == params.N , " Offset batch size must match input batch size." );
You can’t perform that action at this time.
0 commit comments