Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda authored Sep 16, 2024
1 parent f764547 commit 1156e69
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def _matthews_corrcoef_reduce(confmat: Tensor) -> Tensor:
if denom == 0 and confmat.numel() == 4:
if fn == 0 and tn == 0:
a, b = tp, fp
if fp == 0 and tn == 0:
elif fp == 0 and tn == 0:
a, b = tp, fn
if tp == 0 and fn == 0:
elif tp == 0 and fn == 0:
a, b = tn, fp
if tp == 0 and fp == 0:
elif tp == 0 and fp == 0:
a, b = tn, fn
eps = torch.tensor(torch.finfo(torch.float32).eps, dtype=torch.float32, device=confmat.device)
numerator = torch.sqrt(eps) * (a - b)
Expand Down

0 comments on commit 1156e69

Please sign in to comment.