From dc0e23f628fedcde38ac2b09890c86173e8cdc7b Mon Sep 17 00:00:00 2001 From: LeoXing1996 Date: Thu, 2 Mar 2023 13:57:26 +0800 Subject: [PATCH] add more unit test for SWD --- tests/test_metrics/test_swd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_metrics/test_swd.py b/tests/test_metrics/test_swd.py index 46ef4033..c736035a 100644 --- a/tests/test_metrics/test_swd.py +++ b/tests/test_metrics/test_swd.py @@ -23,3 +23,9 @@ def test_swd(init_kwargs, preds, gts, results): np.testing.assert_almost_equal(out / 100, res / 100, decimal=1) swd.reset() assert swd._results == [] + + swd.add(preds[:50], gts[:50]) + swd.add(preds[50:], gts[50:]) + swd_results = swd.compute() + for out, res in zip(swd_results.values(), results): + np.testing.assert_almost_equal(out / 100, res / 100, decimal=1)