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];