@@ -179,7 +179,7 @@ static void convPoolShapeInference_opset19(
179179 }
180180
181181 std::vector<int64_t > effective_kernel_shape = kernel_shape;
182- for (int i = 0 ; i < static_cast < int >( kernel_shape.size () ); i++) {
182+ for (size_t i = 0 ; i < kernel_shape.size (); i++) {
183183 // accounting for dilation, how big is the kernel in this dimension
184184 effective_kernel_shape[i] = (effective_kernel_shape[i] - 1 ) * dilations[i] + 1 ;
185185 }
@@ -193,8 +193,8 @@ static void convPoolShapeInference_opset19(
193193 pads.assign (n_input_dims * 2 , 0 );
194194 const auto * auto_pad_attr = ctx.getAttribute (" auto_pad" );
195195 if ((nullptr != auto_pad_attr) && (auto_pad_attr->s () != " VALID" )) {
196- int input_dims_size = static_cast < int >( n_input_dims) ;
197- for (int i = 0 ; i < input_dims_size; ++i) {
196+ auto input_dims_size = n_input_dims;
197+ for (size_t i = 0 ; i < input_dims_size; ++i) {
198198 int64_t residual = 0 ;
199199 int64_t stride = strides[i];
200200 if (stride > 1 ) {
@@ -206,7 +206,7 @@ static void convPoolShapeInference_opset19(
206206 residual -= stride;
207207 }
208208 }
209- if (i >= static_cast < int >( effective_kernel_shape.size () )) {
209+ if (i >= effective_kernel_shape.size ()) {
210210 fail_shape_inference (" kernel shape should have " , input_dims_size, " values in " , ctx.getDisplayName (), " ." );
211211 }
212212 int64_t total_pad = residual == 0 ? effective_kernel_shape[i] - stride : effective_kernel_shape[i] - residual;
@@ -505,8 +505,8 @@ static void maxUnpoolShapeInference_opset11(InferenceContext& ctx) {
505505 if (output_shape.dim_size () != 1 ) {
506506 fail_type_inference (" 'output_shape' must be rank 1 tensor." );
507507 }
508- if (output_shape.dim (static_cast < int >( 0 ) ).has_dim_value () &&
509- static_cast <int >(output_shape.dim (static_cast < int >( 0 ) ).dim_value ()) != input_shape.dim_size ()) {
508+ if (output_shape.dim (0 ).has_dim_value () &&
509+ static_cast <int >(output_shape.dim (0 ).dim_value ()) != input_shape.dim_size ()) {
510510 fail_shape_inference (" 'output_shape' must have same number of elements as the shape of input tensor X." );
511511 }
512512 }
@@ -670,7 +670,7 @@ static void convTransposeShapeInference_opset11(InferenceContext& ctx) {
670670 }
671671
672672 std::vector<int64_t > effective_kernel_shape = kernel_shape;
673- for (int i = 0 ; i < static_cast < int >( kernel_shape.size () ); i++) {
673+ for (size_t i = 0 ; i < kernel_shape.size (); i++) {
674674 // accounting for dilation, how big is the kernel in this dimension
675675 effective_kernel_shape[i] = (effective_kernel_shape[i] - 1 ) * dilations[i] + 1 ;
676676 }
@@ -2005,7 +2005,7 @@ static void convPoolShapeInference1(
20052005 }
20062006
20072007 std::vector<int64_t > effective_kernel_shape = kernel_shape;
2008- for (int i = 0 ; i < static_cast < int >( kernel_shape.size () ); i++) {
2008+ for (size_t i = 0 ; i < kernel_shape.size (); i++) {
20092009 // accounting for dilation, how big is the kernel in this dimension
20102010 effective_kernel_shape[i] = (effective_kernel_shape[i] - 1 ) * dilations[i] + 1 ;
20112011 }
@@ -2606,8 +2606,8 @@ static void maxUnpoolShapeInference1(InferenceContext& ctx) {
26062606 if (output_shape.dim_size () != 1 ) {
26072607 fail_type_inference (" 'output_shape' must be rank 1 tensor." );
26082608 }
2609- if (output_shape.dim (static_cast < int >( 0 ) ).has_dim_value () &&
2610- static_cast <int >(output_shape.dim (static_cast < int >( 0 ) ).dim_value ()) != input_shape.dim_size ()) {
2609+ if (output_shape.dim (0 ).has_dim_value () &&
2610+ static_cast <int >(output_shape.dim (0 ).dim_value ()) != input_shape.dim_size ()) {
26112611 fail_shape_inference (" 'output_shape' must have same number of elements as the shape of input tensor X." );
26122612 }
26132613 }
@@ -3016,7 +3016,7 @@ static void convTransposeShapeInference1(InferenceContext& ctx) {
30163016 }
30173017
30183018 std::vector<int64_t > effective_kernel_shape = kernel_shape;
3019- for (int i = 0 ; i < static_cast < int >( kernel_shape.size () ); i++) {
3019+ for (size_t i = 0 ; i < kernel_shape.size (); i++) {
30203020 // accounting for dilation, how big is the kernel in this dimension
30213021 effective_kernel_shape[i] = (effective_kernel_shape[i] - 1 ) * dilations[i] + 1 ;
30223022 }
0 commit comments