Skip to content

Commit

Permalink
change metric wrappers to keep graddable metrics graddable
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoss13 committed Feb 7, 2024
1 parent 551b9b7 commit fdaf384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion labproject/metrics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def wrapper(*args, **kwargs):
metric = func(*args, **kwargs)

# Convert output to tensor
metric = torch.tensor(metric)
if not isinstance(metric, torch.Tensor):
metric = torch.tensor(metric)

return metric

Expand Down

0 comments on commit fdaf384

Please sign in to comment.