From ee23b131023680ca51c46f85a48b26a8e9de374e Mon Sep 17 00:00:00 2001 From: zesongw Date: Thu, 30 Nov 2023 15:00:30 +0800 Subject: [PATCH] Resolve comment --- .../core/providers/webnn/builders/impl/conv_op_builder.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onnxruntime/core/providers/webnn/builders/impl/conv_op_builder.cc b/onnxruntime/core/providers/webnn/builders/impl/conv_op_builder.cc index 4cfc4e8a2ca42..b37340624f850 100644 --- a/onnxruntime/core/providers/webnn/builders/impl/conv_op_builder.cc +++ b/onnxruntime/core/providers/webnn/builders/impl/conv_op_builder.cc @@ -258,6 +258,8 @@ Status ConvOpBuilder::AddToModelBuilderImpl(ModelBuilder& model_builder, const N total_padding[i] = strides[i] * (narrow(input_shape[i + 1]) - 1) + output_padding[i] + ((kernel_shape[i] - 1) * dilations[i] + 1) - output_shape[i]; } else { + ORT_RETURN_IF_NOT(model_builder.GetPreferredLayout() == DataLayout::NCHW, + "WebNN GPU backend preferred layout should be NCHW."); total_padding[i] = strides[i] * (narrow(input_shape[i + 2]) - 1) + output_padding[i] + ((kernel_shape[i] - 1) * dilations[i] + 1) - output_shape[i]; }