mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-06-24 14:33:20 +00:00
[NFC] polish colossalai/nn/metric/_utils.py code style (#1727)
This commit is contained in:
parent
754aa7c81f
commit
23703c9dd6
@ -1,5 +1,6 @@
|
|||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
|
||||||
def calc_acc(logits, targets):
|
def calc_acc(logits, targets):
|
||||||
preds = torch.argmax(logits, dim=-1)
|
preds = torch.argmax(logits, dim=-1)
|
||||||
correct = torch.sum(targets == preds)
|
correct = torch.sum(targets == preds)
|
||||||
|
Loading…
Reference in New Issue
Block a user