Skip to content

Commit

Permalink
[js/webgpu] fix a bug in transpose shader (microsoft#22997)
Browse files Browse the repository at this point in the history
### Description

Fix a bug in transpose shader, when input/output rank is 1.

### Motivation and Context

Fixes microsoft#22994
  • Loading branch information
fs-eire authored and ankitm3k committed Dec 11, 2024
1 parent 6eebfa8 commit ce9f876
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/web/lib/wasm/jsep/webgpu/ops/transpose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const createTransposeProgramInfo = (inputTensor: TensorView, permAttr: nu
const outputShape = getOutputShape(inputTensor.dims, perm);
let newInputShape = inputTensor.dims;
let newOutputShape = outputShape;
const transposeAsReshape = isTransposeReshape(perm, inputTensor.dims);
const transposeAsReshape = inputRank < 2 || isTransposeReshape(perm, inputTensor.dims);
let getShaderSource;
if (transposeAsReshape) {
getShaderSource = (shaderHelper: ShaderHelper) => {
Expand Down

0 comments on commit ce9f876

Please sign in to comment.