Skip to content

Commit

Permalink
[js/webgpu] fix RangeError in buffer download (#16165)
Browse files Browse the repository at this point in the history
### Description
this is a following up fix for #15990, which should resolve the
RangeError issue.
  • Loading branch information
fs-eire authored May 30, 2023
1 parent bf05d4e commit ebe715a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/web/lib/wasm/jsep/backend-webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class WebGpuBackend {
// the underlying buffer may be changed after the async function is called. so we use a getter function to make sure
// the buffer is up-to-date.
const data = getTargetBuffer();
data.set(new Uint8Array(arrayBuffer));
data.set(new Uint8Array(arrayBuffer, 0, data.byteLength));
}

alloc(size: number): number {
Expand Down

0 comments on commit ebe715a

Please sign in to comment.