mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-26 22:35:43 +00:00
[WebNN EP] Fixed a minor bug in ConvTranspose (#22384)
For ConvTranspose, the filter should be transposed from iohw -> ohwi if it is NHWC preferred layout.
This commit is contained in:
parent
e6e94e6252
commit
034ab4fa04
1 changed files with 2 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ Status AddInitializerInNewLayout(ModelBuilder& model_builder,
|
|||
const auto out_t = dims[0], in_t = dims[1],
|
||||
h_t = dims[2], w_t = dims[3];
|
||||
std::vector<uint32_t> dest_shape;
|
||||
if (is_conv == 1)
|
||||
if (is_conv)
|
||||
dest_shape = {out_t, h_t, w_t, in_t}; // L_0231
|
||||
else
|
||||
dest_shape = {in_t, h_t, w_t, out_t}; // L_1230 for depthwise conv and convTranspose weight
|
||||
|
|
@ -265,7 +265,7 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N
|
|||
options.set("inputLayout", emscripten::val("nhwc"));
|
||||
options.set("filterLayout", emscripten::val("ohwi"));
|
||||
if (is_constant_weight) {
|
||||
ORT_RETURN_IF_ERROR(AddInitializerInNewLayout(model_builder, weight_name, true, is_conv1d));
|
||||
ORT_RETURN_IF_ERROR(AddInitializerInNewLayout(model_builder, weight_name, false, is_conv1d));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue