def test_accuracy_top1():
    """
    Tests for catalyst.metrics.accuracy metric.
    """
    for i in range(NUM_CLASSES):
        outputs = torch.zeros((BATCH_SIZE, NUM_CLASSES))
        outputs[:, i] = 1
        targets = torch.ones((BATCH_SIZE, 1)) * i

        top1, top3, top5 = accuracy(outputs, targets, topk=(1, 3, 5))
        assert np.isclose(top1, 1)
        assert np.isclose(top3, 1)
        assert np.isclose(top5, 1)

    Tests for catalyst.metrics.accuracy metric.
    
tests/catalyst/metrics/functional/test_accuracy.py