Thank you very much for the fast reply.
Lets say I leave y as the class indicies like this
Target data (y): shape=(23445, 1), array([0, 0, 1, …, 1, 1, 1]), dtype=int64
And I change the network architecture to have only 1 output neuron
# Network architecture
class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.fc1 = nn.Linear(128, 100)
        self.fc2 = nn.Linear(100, 1)

    def forward(self, x):
        x = x.view(-1, 128)
        x = F.relu(self.fc1(x))
        x = self.fc2(x)
        return x

net = Net()

Do you have a recommendation how to make this work?
Or should I stay with 2 output neurons and choose CELoss as it is a multi-class problem?