Skip to content

Commit 3b86267

Browse files
committed
Merge branch 'main' into docs
2 parents 4878d02 + 13b570c commit 3b86267

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pipelines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ export class FeatureExtractionPipeline extends Pipeline {
669669
*/
670670
_normalize(tensor) {
671671
for (let batch of tensor) {
672-
let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b))
672+
let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b, 0))
673673

674674
for (let i = 0; i < batch.data.length; ++i) {
675675
batch.data[i] /= norm;

0 commit comments

Comments
 (0)