Skip to content

Commit e3c69a5

Browse files
authored
Fill dtype defaults to 'float' in backend_wasm
1 parent 0a15977 commit e3c69a5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

tfjs-backend-wasm/src/backend_wasm.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,14 +328,12 @@ export async function init(): Promise<{wasm: BackendWasmModule}> {
328328
function typedArrayFromBuffer(
329329
buffer: ArrayBuffer, dtype: DataType): backend_util.TypedArray {
330330
switch (dtype) {
331-
case 'float32':
332-
return new Float32Array(buffer);
333331
case 'int32':
334332
return new Int32Array(buffer);
335333
case 'bool':
336334
return new Uint8Array(buffer);
337335
default:
338-
throw new Error(`Unknown dtype ${dtype}`);
336+
return new Float32Array(buffer);
339337
}
340338
}
341339

0 commit comments

Comments
 (0)