Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/web/lib/wasm/jsep/webgpu/ops/conv-transpose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const parseConvTransposeAttributes = (attributes: Record<string, unknown>
typeof attributes.autoPad == 'undefined' ? 0 : (attributes.autoPad as number)
];
const dilations = attributes.dilations as [number, number];
const group = attributes.group as number;
const group = (attributes.group as number) ?? 1; // default to 1 per ONNX spec
const kernelShape = attributes.kernelShape as [number, number];
const pads = attributes.pads as [number, number, number, number];
const strides = attributes.strides as [number, number];
Expand Down
5 changes: 5 additions & 0 deletions onnxruntime/core/providers/webgpu/nn/conv_transpose.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ Status ConvTranspose<is_channels_last>::ComputeInternal(ComputeContext& context)

bool has_bias = context.InputCount() > 2;
const auto* bias = has_bias ? context.Input<Tensor>(2) : nullptr;
// Validate bias shape if provided
if (has_bias && (bias->Shape().NumDimensions() != 1 || bias->Shape()[0] != num_output_channels)) {
return ORT_MAKE_STATUS(ONNXRUNTIME, INVALID_ARGUMENT, "invalid bias");
}

if (input_shape.NumDimensions() == 3 && filter_shape.NumDimensions() == 3) {
// ConvTranspose1D
TensorShapeVector input_shape_vector = input_shape.AsShapeVector();
Expand Down
Loading