Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
guschmue committed Jan 9, 2024
1 parent 10db421 commit 6e3182e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/web/lib/wasm/jsep/webgpu/ops/where.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ const createWhereOpProgramInfo = (inputs: readonly TensorView[]): ProgramInfo =>
const outputDataType = inputs[1].dataType;

const isBroadcast = !(ShapeUtil.areEqual(dimsA, dimsB) && ShapeUtil.areEqual(dimsB, dimsC));
let outputShape = dimsC;
let outputSize = ShapeUtil.size(dimsC);
const vecSize = Math.ceil(outputSize / 4);
let outputShape = dimsA;
let outputSize = ShapeUtil.size(dimsA);
// 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 6e3182e

Please sign in to comment.