Skip to content

Commit

Permalink
Check if key input is null
Browse files Browse the repository at this point in the history
  • Loading branch information
satyajandhyala committed Jan 6, 2025
1 parent 0db515f commit ef489ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/web/lib/wasm/jsep/webgpu/ops/group-query-attention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const validateInputs = (
let kvSequenceLength = sequenceLength;

let pastSequenceLength = 0;
const packedQKV = !key || key.dims.length === 0 || ShapeUtil.size(key.dims) === 0;
const packedQKV = !key || key === null || key.dims.length === 0 || ShapeUtil.size(key.dims) === 0;
const headSize = !packedQKV
? Math.floor(hiddenSize / attributes.numHeads)
: Math.floor(hiddenSize / (attributes.numHeads + 2 * attributes.kvNumHeads));
Expand Down

0 comments on commit ef489ea

Please sign in to comment.