Skip to content

Commit

Permalink
[js/webgpu] fix bcast in where (#19009)
Browse files Browse the repository at this point in the history
  • Loading branch information
guschmue authored Jan 11, 2024
1 parent 5349770 commit d0bac82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/web/lib/wasm/jsep/webgpu/ops/where.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const createWhereOpProgramInfo = (inputs: readonly TensorView[]): ProgramInfo =>
const isBroadcast = !(ShapeUtil.areEqual(dimsA, dimsB) && ShapeUtil.areEqual(dimsB, dimsC));
let outputShape = dimsA;
let outputSize = ShapeUtil.size(dimsA);
const vecSize = Math.ceil(outputSize / 4);
// TODO: deal with zero-sized tensors (eg. dims=[1,0])

if (isBroadcast) {
Expand All @@ -88,6 +87,8 @@ const createWhereOpProgramInfo = (inputs: readonly TensorView[]): ProgramInfo =>
outputSize = ShapeUtil.size(outputShape);
}

const vecSize = Math.ceil(outputSize / 4);

return {
name: 'Where',
shaderCache: {inputDependencies: ['rank', 'rank', 'rank']},
Expand Down

0 comments on commit d0bac82

Please sign in to comment.