@@ -78,7 +78,7 @@ common::Status SetConvBaseOptions(ModelBuilder& model_builder,
7878 if (output_padding.size () == 1 && is_conv1d) {
7979 output_padding.push_back (0 );
8080 }
81- options.set (" outputPadding" , emscripten::val::array (GetNarrowedIntfromInt64 <uint32_t >(output_padding)));
81+ options.set (" outputPadding" , emscripten::val::array (GetNarrowedIntFromInt64 <uint32_t >(output_padding)));
8282
8383 // If output shape is explicitly provided, compute the pads.
8484 // Otherwise compute the output shape, as well as the pads if the auto_pad attribute is SAME_UPPER/SAME_LOWER.
@@ -87,7 +87,7 @@ common::Status SetConvBaseOptions(ModelBuilder& model_builder,
8787 auto_pad_type, pads_out, output_shape, !is_nhwc));
8888
8989 if (output_shape[0 ] != -1 && output_shape[1 ] != -1 ) {
90- options.set (" outputSizes" , emscripten::val::array (GetNarrowedIntfromInt64 <uint32_t >(output_shape)));
90+ options.set (" outputSizes" , emscripten::val::array (GetNarrowedIntFromInt64 <uint32_t >(output_shape)));
9191 }
9292 pads = pads_out;
9393 } else {
@@ -97,13 +97,13 @@ common::Status SetConvBaseOptions(ModelBuilder& model_builder,
9797
9898 const auto group = helper.Get (" group" , static_cast <uint32_t >(1 ));
9999 options.set (" groups" , group);
100- options.set (" strides" , emscripten::val::array (GetNarrowedIntfromInt64 <uint32_t >(strides)));
101- options.set (" dilations" , emscripten::val::array (GetNarrowedIntfromInt64 <uint32_t >(dilations)));
100+ options.set (" strides" , emscripten::val::array (GetNarrowedIntFromInt64 <uint32_t >(strides)));
101+ options.set (" dilations" , emscripten::val::array (GetNarrowedIntFromInt64 <uint32_t >(dilations)));
102102
103103 // Permute the ONNX's pads, which is [beginning_height, beginning_width, ending_height, ending_width],
104104 // while WebNN's padding is [beginning_height, ending_height, beginning_width, ending_width].
105105 const std::vector<int64_t > padding{pads[0 ], pads[2 ], pads[1 ], pads[3 ]};
106- options.set (" padding" , emscripten::val::array (GetNarrowedIntfromInt64 <uint32_t >(padding)));
106+ options.set (" padding" , emscripten::val::array (GetNarrowedIntFromInt64 <uint32_t >(padding)));
107107
108108 // Add bias if present.
109109 if (input_defs.size () > 2 && op_type != " ConvInteger" ) {
@@ -123,7 +123,7 @@ Status AddInitializerInNewLayout(ModelBuilder& model_builder,
123123
124124 const auto & shape = tensor.dims ();
125125 std::vector<uint32_t > dims =
126- GetNarrowedIntfromInt64 <uint32_t >(std::vector<int64_t >(std::begin (shape), std::end (shape)));
126+ GetNarrowedIntFromInt64 <uint32_t >(std::vector<int64_t >(std::begin (shape), std::end (shape)));
127127
128128 if (is_conv1d) {
129129 // Support conv1d by prepending a 1 size dimension.
@@ -172,21 +172,21 @@ Status AddInitializerInNewLayout(ModelBuilder& model_builder,
172172 h * w_t +
173173 w;
174174
175- uint32_t nnapi_idx ;
175+ uint32_t wnn_idx ;
176176 if (is_conv == 1 ) { // L_0231
177- nnapi_idx = out * h_t * w_t * in_t +
178- h * w_t * in_t +
179- w * in_t +
180- in;
177+ wnn_idx = out * h_t * w_t * in_t +
178+ h * w_t * in_t +
179+ w * in_t +
180+ in;
181181 } else { // L_1230 for depthwise conv weight
182- nnapi_idx = in * h_t * w_t * out_t +
183- h * w_t * out_t +
184- w * out_t +
185- out;
182+ wnn_idx = in * h_t * w_t * out_t +
183+ h * w_t * out_t +
184+ w * out_t +
185+ out;
186186 }
187187
188188 for (size_t i = 0 ; i < element_size; i++) {
189- buffer[element_size * nnapi_idx + i] = src[element_size * onnx_idx + i];
189+ buffer[element_size * wnn_idx + i] = src[element_size * onnx_idx + i];
190190 }
191191 }
192192 }
@@ -234,7 +234,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
234234 } else {
235235 input_shape.push_back (1 );
236236 }
237- std::vector<uint32_t > new_shape = GetNarrowedIntfromInt64 <uint32_t >(input_shape);
237+ std::vector<uint32_t > new_shape = GetNarrowedIntFromInt64 <uint32_t >(input_shape);
238238 common_options.set (" label" , node.Name () + " _reshape_input" );
239239 input = model_builder.GetBuilder ().call <emscripten::val>(" reshape" , input,
240240 emscripten::val::array (new_shape), common_options);
@@ -283,7 +283,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
283283 // Reshape weight to 4D for conv1d.
284284 if (!is_nhwc || !is_constant_weight) {
285285 // The weight_shape has been appended 1's, reshape weight operand.
286- std::vector<uint32_t > new_shape = GetNarrowedIntfromInt64 <uint32_t >(weight_shape);
286+ std::vector<uint32_t > new_shape = GetNarrowedIntFromInt64 <uint32_t >(weight_shape);
287287 common_options.set (" label" , node.Name () + " _reshape_filter" );
288288 filter = model_builder.GetBuilder ().call <emscripten::val>(" reshape" ,
289289 filter,
@@ -338,7 +338,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
338338 std::vector<int64_t > w_zero_point_shape;
339339 ORT_RETURN_IF_NOT (GetShape (*input_defs[3 ], w_zero_point_shape, logger), " Cannot get shape of w_zero_point" );
340340 w_scale = model_builder.CreateOrGetConstant <float >(ONNX_NAMESPACE::TensorProto_DataType_FLOAT, 1 .0f ,
341- GetNarrowedIntfromInt64 <uint32_t >(w_zero_point_shape));
341+ GetNarrowedIntFromInt64 <uint32_t >(w_zero_point_shape));
342342 } else {
343343 w_zero_point = model_builder.CreateOrGetConstant <uint8_t >(x_type, 0 );
344344 w_scale = x_scale;
@@ -363,7 +363,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
363363 const auto & output_defs = node.OutputDefs ();
364364 std::vector<int64_t > output_shape;
365365 ORT_RETURN_IF_NOT (GetShape (*output_defs[0 ], output_shape, logger), " Cannot get output shape" );
366- std::vector<uint32_t > new_shape = GetNarrowedIntfromInt64 <uint32_t >(output_shape);
366+ std::vector<uint32_t > new_shape = GetNarrowedIntFromInt64 <uint32_t >(output_shape);
367367 common_options.set (" label" , node.Name () + " _reshape_output" );
368368 output = model_builder.GetBuilder ().call <emscripten::val>(" reshape" ,
369369 output,
0 commit comments