Skip to content

Commit 187da14

Browse files
committed
fix: resolve mypy type error in utils.py
Signed-off-by: Rusheel Sharma <rusheelhere@gmail.com>
1 parent af83422 commit 187da14

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

monai/metrics/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def get_edge_surface_distance(
359359
if len(edge_results) > 2 and isinstance(edge_results[2], tuple):
360360
slices = edge_results[2]
361361
mask = mask[slices]
362-
mask = mask.to(edges_pred.device).bool()
362+
mask = torch.as_tensor(mask, device=edges_pred.device, dtype=torch.bool)
363363
edges_pred = edges_pred & mask
364364
edges_gt = edges_gt & mask
365365

0 commit comments

Comments
 (0)