Sure! I just used these random input and checked the result manually:
label = torch.randint(0, 5, (10,))
index_to_one_hot(label)
preds = torch.randn(10, 5)
compute_accuracy(preds, index_to_one_hot(label))