From 704434f7ae287e4212e70a0144cf312c2ee297af Mon Sep 17 00:00:00 2001 From: Ping Yu <4018+pyu10055@users.noreply.github.com> Date: Thu, 2 Jul 2020 13:25:54 -0700 Subject: [PATCH 1/3] use array close --- tfjs-core/src/ops/max_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-core/src/ops/max_test.ts b/tfjs-core/src/ops/max_test.ts index 147bd131c78..61c1cc3388a 100644 --- a/tfjs-core/src/ops/max_test.ts +++ b/tfjs-core/src/ops/max_test.ts @@ -97,7 +97,7 @@ describeWithFlags('max', ALL_ENVS, () => { tf.max(input, [1, 0]); const inputDataAfter = await input.data(); - expectArraysEqual(inputDataBefore, inputDataAfter); + expectArraysClose(inputDataBefore, inputDataAfter); }); it('throws when passed a non-tensor', () => { From cb7d06d7f555d499d19f0d400803b8d4d7f4dc24 Mon Sep 17 00:00:00 2001 From: Ping Yu <4018+pyu10055@users.noreply.github.com> Date: Thu, 2 Jul 2020 14:15:09 -0700 Subject: [PATCH 2/3] fix lint --- tfjs-core/src/ops/max_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-core/src/ops/max_test.ts b/tfjs-core/src/ops/max_test.ts index 61c1cc3388a..f48f4cf7567 100644 --- a/tfjs-core/src/ops/max_test.ts +++ b/tfjs-core/src/ops/max_test.ts @@ -17,7 +17,7 @@ import * as tf from '../index'; import {ALL_ENVS, describeWithFlags} from '../jasmine_util'; -import {expectArraysClose, expectArraysEqual} from '../test_util'; +import {expectArraysClose} from '../test_util'; describeWithFlags('max', ALL_ENVS, () => { it('with one element dominating', async () => { From 4057dc3a30df334244b07c2f5a149aa2128a0413 Mon Sep 17 00:00:00 2001 From: Ping Yu <4018+pyu10055@users.noreply.github.com> Date: Thu, 2 Jul 2020 17:32:32 -0700 Subject: [PATCH 3/3] use array close --- tfjs-core/src/ops/min_test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tfjs-core/src/ops/min_test.ts b/tfjs-core/src/ops/min_test.ts index aeb3b62c285..f6329b0653f 100644 --- a/tfjs-core/src/ops/min_test.ts +++ b/tfjs-core/src/ops/min_test.ts @@ -17,7 +17,7 @@ import * as tf from '../index'; import {ALL_ENVS, describeWithFlags} from '../jasmine_util'; -import {expectArraysClose, expectArraysEqual} from '../test_util'; +import {expectArraysClose} from '../test_util'; describeWithFlags('min', ALL_ENVS, () => { it('Tensor1D', async () => { @@ -27,7 +27,7 @@ describeWithFlags('min', ALL_ENVS, () => { it('ignores NaNs', async () => { const a = tf.tensor1d([3, NaN, 2]); - expectArraysEqual(await tf.min(a).data(), 2); + expectArraysClose(await tf.min(a).data(), 2); }); it('2D', async () => { @@ -81,7 +81,7 @@ describeWithFlags('min', ALL_ENVS, () => { tf.min(input, [1, 0]); const inputDataAfter = await input.data(); - expectArraysEqual(inputDataBefore, inputDataAfter); + expectArraysClose(inputDataBefore, inputDataAfter); }); it('throws when passed a non-tensor', () => {