mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-02 03:55:34 +00:00
[js/webgpu] Fix f16 errors for ConvTranspose2D (#18986)
### Description <!-- Describe your changes. --> ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
This commit is contained in:
parent
4e2d88b75f
commit
867b9d8f04
1 changed files with 3 additions and 3 deletions
|
|
@ -157,7 +157,7 @@ const createConvTranspose2DOpProgramShaderSource =
|
|||
}
|
||||
|
||||
for (var i: u32 = 0; i < ${workPerThread}; i = i + 1) {
|
||||
let value = dotProd[i] + ${hasBias ? 'bias[c+i]' : '0.0'};
|
||||
let value = dotProd[i] + ${hasBias ? 'bias[c+i]' : `vec4<${dataType}>(0.0)`};
|
||||
${output.set('batch', 'r', 'c + i', 'd1', 'value')};
|
||||
}
|
||||
}`;
|
||||
|
|
@ -174,7 +174,7 @@ const createConvTranspose2DOpProgramShaderSource =
|
|||
let wOutChannel = d1 - groupId * ${outputChannelsPerGroup};
|
||||
// Convolve dy(?, ?, d2) with w(:, :, d1, d2) to compute dx(xR, xC, d1).
|
||||
// ? = to be determined. : = across all values in that axis.
|
||||
var dotProd = 0.0;
|
||||
var dotProd = ${dataType}(0.0);
|
||||
for (var wR: u32 = 0; wR < effectiveFilterDims.x; wR = wR + 1) {
|
||||
if (wR % dilations.x != 0) {
|
||||
continue;
|
||||
|
|
@ -209,7 +209,7 @@ const createConvTranspose2DOpProgramShaderSource =
|
|||
}
|
||||
}
|
||||
}
|
||||
let value = dotProd + ${hasBias ? 'bias[d1]' : '0.0'};
|
||||
let value = dotProd + ${hasBias ? 'bias[d1]' : `${dataType}(0.0)`};
|
||||
${output.setByOffset('global_idx', 'value')};
|
||||
`;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue