Hard to say what is the error here without knowing what are train_y and output1.
The following sample code may help you:
batch_size  = 64
num_classes = 2

dummy_outputs = torch.randn(batch_size, num_classes)
dummy_targets = torch.randint(num_classes, size=(batch_size, ))

predictions = dummy_outputs.softmax(dim=1).argmax(dim=1).numpy()
targets     = dummy_targets.numpy()

accuracy = accuracy_score(targets, predictions)

print(accuracy) # around 0.5 since random predictions and random targets