Skip to content

Commit

Permalink
update dynunet_wrapper.py
Browse files Browse the repository at this point in the history
- change raise ValueError with assert
  • Loading branch information
benmalef committed Oct 6, 2024
1 parent 0fc7fc4 commit 4c3da18
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions GANDLF/models/dynunet_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ def get_kernels_strides(sizes, spacings):
if all(s == 1 for s in stride):
break
for idx, (i, j) in enumerate(zip(sizes, stride)):
if i % j != 0:
raise ValueError(
f"Patch size is not supported, please try to modify the size {input_size[idx]} in the spatial dimension {idx}."
)
assert (
i % j == 0
), f"Patch size is not supported, please try to modify the size {input_size[idx]} in the spatial dimension {idx}."
sizes = [i / j for i, j in zip(sizes, stride)]
spacings = [i * j for i, j in zip(spacings, stride)]
kernels.append(kernel)
Expand Down

0 comments on commit 4c3da18

Please sign in to comment.