Fix output Float32Array size in webgpu export (#2096)

This commit is contained in:
Ahmed Harmouche
2023-10-17 15:28:19 -07:00
committed by GitHub
parent 01b98b7f42
commit 2b5ea7d9cb
+1 -1
View File
@@ -121,7 +121,7 @@ const setupNet = async (device, safetensor) => {{
device.queue.submit([gpuCommands]);
await gpuReadBuffer.mapAsync(GPUMapMode.READ);
const resultBuffer = new Float32Array(gpuReadBuffer.size);
const resultBuffer = new Float32Array(gpuReadBuffer.size/4);
resultBuffer.set(new Float32Array(gpuReadBuffer.getMappedRange()));
gpuReadBuffer.unmap();
return resultBuffer;