From cc859de9ca25a259dd0c3ccef084569e5854fde6 Mon Sep 17 00:00:00 2001 From: jbencook Date: Fri, 15 Jun 2018 10:51:37 -0500 Subject: [PATCH] fix index for min --- src/kernels/backend_cpu.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernels/backend_cpu.ts b/src/kernels/backend_cpu.ts index 1572f0cca2..9b029996f4 100644 --- a/src/kernels/backend_cpu.ts +++ b/src/kernels/backend_cpu.ts @@ -560,7 +560,7 @@ export class MathBackendCPU implements KernelBackend { const aVals = x.dataSync(); for (let i = 0; i < vals.length; ++i) { const offset = i * reduceSize; - let min = aVals[0]; + let min = aVals[offset]; for (let j = 0; j < reduceSize; ++j) { const value = aVals[offset + j]; if (value < min) {