Skip to content

Commit

Permalink
removed unnecessary float32 array
Browse files Browse the repository at this point in the history
  • Loading branch information
carzh committed Nov 22, 2023
1 parent 8e05bcc commit 242cebe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/web/lib/wasm/wasm-training-core-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 242cebe

Please sign in to comment.