Skip to content

Commit

Permalink
add more unit test for SWD
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoXing1996 committed Mar 2, 2023
1 parent 55d8ae8 commit dc0e23f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_metrics/test_swd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit dc0e23f

Please sign in to comment.