Skip to content

Commit

Permalink
build(deps): bump monai from 1.3.2 to 1.4.0 in /requirements (#2795)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nicki Skafte <[email protected]>
  • Loading branch information
dependabot[bot] and SkafteNicki authored Oct 22, 2024
1 parent 06f2015 commit d1d3242
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements/segmentation_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment

scipy >1.0.0, <1.15.0
monai ==1.3.2
monai ==1.4.0
4 changes: 2 additions & 2 deletions tests/unittests/_helpers/testers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _assert_allclose(tm_result: Any, ref_result: Any, atol: float = 1e-8, key: O
ref_result.detach().cpu().numpy() if isinstance(ref_result, Tensor) else ref_result,
atol=atol,
equal_nan=True,
)
), f"tm_result: {tm_result}, ref_result: {ref_result}"
# multi output compare
elif isinstance(tm_result, Sequence):
for pl_res, ref_res in zip(tm_result, ref_result):
Expand All @@ -50,7 +50,7 @@ def _assert_allclose(tm_result: Any, ref_result: Any, atol: float = 1e-8, key: O
ref_result.detach().cpu().numpy() if isinstance(ref_result, Tensor) else ref_result,
atol=atol,
equal_nan=True,
)
), f"tm_result: {tm_result}, ref_result: {ref_result}"
else:
raise ValueError("Unknown format for comparison")

Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/segmentation/test_generalized_dice_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ def _reference_generalized_dice(
if input_format == "index":
preds = torch.nn.functional.one_hot(preds, num_classes=NUM_CLASSES).movedim(-1, 1)
target = torch.nn.functional.one_hot(target, num_classes=NUM_CLASSES).movedim(-1, 1)
val = compute_generalized_dice(preds, target, include_background=include_background)
val = compute_generalized_dice(preds, target, include_background=include_background, sum_over_classes=True)
if reduce:
val = val.mean()
return val
return val.squeeze()


@pytest.mark.parametrize(
Expand Down

0 comments on commit d1d3242

Please sign in to comment.