mirror of https://github.com/hpcaitech/ColossalAI
[NFC] polish colossalai/nn/metric/_utils.py code style (#1727)
parent
754aa7c81f
commit
23703c9dd6
|
@ -1,5 +1,6 @@
|
|||
import torch
|
||||
|
||||
|
||||
def calc_acc(logits, targets):
|
||||
preds = torch.argmax(logits, dim=-1)
|
||||
correct = torch.sum(targets == preds)
|
||||
|
|
Loading…
Reference in New Issue