[NFC] polish colossalai/nn/metric/_utils.py code style (#1727)

pull/1743/head
Sze-qq 2022-10-18 20:05:47 +08:00 committed by Frank Lee
parent 754aa7c81f
commit 23703c9dd6
1 changed files with 1 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import torch
def calc_acc(logits, targets):
preds = torch.argmax(logits, dim=-1)
correct = torch.sum(targets == preds)