@@ -78,7 +78,7 @@ common::Status SetConvBaseOptions(ModelBuilder& model_builder,
78
78
if (output_padding.size () == 1 && is_conv1d) {
79
79
output_padding.push_back (0 );
80
80
}
81
- options.set (" outputPadding" , emscripten::val::array (GetNarrowedIntfromInt64 <uint32_t >(output_padding)));
81
+ options.set (" outputPadding" , emscripten::val::array (GetNarrowedIntFromInt64 <uint32_t >(output_padding)));
82
82
83
83
// If output shape is explicitly provided, compute the pads.
84
84
// 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,
87
87
auto_pad_type, pads_out, output_shape, !is_nhwc));
88
88
89
89
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)));
91
91
}
92
92
pads = pads_out;
93
93
} else {
@@ -97,13 +97,13 @@ common::Status SetConvBaseOptions(ModelBuilder& model_builder,
97
97
98
98
const auto group = helper.Get (" group" , static_cast <uint32_t >(1 ));
99
99
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)));
102
102
103
103
// Permute the ONNX's pads, which is [beginning_height, beginning_width, ending_height, ending_width],
104
104
// while WebNN's padding is [beginning_height, ending_height, beginning_width, ending_width].
105
105
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)));
107
107
108
108
// Add bias if present.
109
109
if (input_defs.size () > 2 && op_type != " ConvInteger" ) {
@@ -123,7 +123,7 @@ Status AddInitializerInNewLayout(ModelBuilder& model_builder,
123
123
124
124
const auto & shape = tensor.dims ();
125
125
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)));
127
127
128
128
if (is_conv1d) {
129
129
// Support conv1d by prepending a 1 size dimension.
@@ -172,21 +172,21 @@ Status AddInitializerInNewLayout(ModelBuilder& model_builder,
172
172
h * w_t +
173
173
w;
174
174
175
- uint32_t nnapi_idx ;
175
+ uint32_t wnn_idx ;
176
176
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;
181
181
} 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;
186
186
}
187
187
188
188
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];
190
190
}
191
191
}
192
192
}
@@ -234,7 +234,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
234
234
} else {
235
235
input_shape.push_back (1 );
236
236
}
237
- std::vector<uint32_t > new_shape = GetNarrowedIntfromInt64 <uint32_t >(input_shape);
237
+ std::vector<uint32_t > new_shape = GetNarrowedIntFromInt64 <uint32_t >(input_shape);
238
238
common_options.set (" label" , node.Name () + " _reshape_input" );
239
239
input = model_builder.GetBuilder ().call <emscripten::val>(" reshape" , input,
240
240
emscripten::val::array (new_shape), common_options);
@@ -283,7 +283,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
283
283
// Reshape weight to 4D for conv1d.
284
284
if (!is_nhwc || !is_constant_weight) {
285
285
// 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);
287
287
common_options.set (" label" , node.Name () + " _reshape_filter" );
288
288
filter = model_builder.GetBuilder ().call <emscripten::val>(" reshape" ,
289
289
filter,
@@ -338,7 +338,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
338
338
std::vector<int64_t > w_zero_point_shape;
339
339
ORT_RETURN_IF_NOT (GetShape (*input_defs[3 ], w_zero_point_shape, logger), " Cannot get shape of w_zero_point" );
340
340
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));
342
342
} else {
343
343
w_zero_point = model_builder.CreateOrGetConstant <uint8_t >(x_type, 0 );
344
344
w_scale = x_scale;
@@ -363,7 +363,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
363
363
const auto & output_defs = node.OutputDefs ();
364
364
std::vector<int64_t > output_shape;
365
365
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);
367
367
common_options.set (" label" , node.Name () + " _reshape_output" );
368
368
output = model_builder.GetBuilder ().call <emscripten::val>(" reshape" ,
369
369
output,
0 commit comments