From 242cebe246b41d2e4073e8b0d0fb60d867f48e8e Mon Sep 17 00:00:00 2001 From: carzh Date: Wed, 22 Nov 2023 10:26:49 -0800 Subject: [PATCH] removed unnecessary float32 array --- js/web/lib/wasm/wasm-training-core-impl.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/web/lib/wasm/wasm-training-core-impl.ts b/js/web/lib/wasm/wasm-training-core-impl.ts index f5cf031c398b8..1e4cc7e6a0d4e 100644 --- a/js/web/lib/wasm/wasm-training-core-impl.ts +++ b/js/web/lib/wasm/wasm-training-core-impl.ts @@ -347,11 +347,9 @@ export const getContiguousParameters = const parametersSize = getParametersSize(trainingSessionId, trainableOnly); let tensor = 0; - // allocates a Float32Array of the correct size on the WASM heap + // allocates a buffer of the correct size on the WASM heap const paramsByteLength = 4 * parametersSize; const paramsOffset = wasm._malloc(paramsByteLength); - const arr = new Float32Array(parametersSize); - wasm.HEAPU8.set(arr, paramsOffset); // handles the dimensions-related createTensor parameters const dims = [parametersSize];