If you look at the docs, nn.BCEWithLogitsLoss() expects input and target of shape (N,*).
Essentially, this means that if you use input of shape (N,10), then 10 individual BCE-Loss() will be performed, its sort of a multi-label BCE which is not your end goal.
You must rather use a nn.CrossEntropyLoss() because you have two labels which are explicitly coded as zeroth and first class.

For example, let’s say input is of shape (3,10), with 3 being the batch-size.
Your target must be of shape (3,1) or just (3, ) and each entry in this variable will be the class associated for that particular batch.
In your case, the target must span between only 0 and 1, since you are focusing only on the zeroth and first class.