We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4878d02 + 13b570c commit 3b86267Copy full SHA for 3b86267
src/pipelines.js
@@ -669,7 +669,7 @@ export class FeatureExtractionPipeline extends Pipeline {
669
*/
670
_normalize(tensor) {
671
for (let batch of tensor) {
672
- let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b))
+ let norm = Math.sqrt(batch.data.reduce((a, b) => a + b * b, 0))
673
674
for (let i = 0; i < batch.data.length; ++i) {
675
batch.data[i] /= norm;
0 commit comments