Since your model learned to predict the binary class. logits will have the shape of [batch_size, seq_len, 1] already. Indexing logits[:, :, -1] will basically return the same values but with different shape [batch_size, seq_len].
In order to forward these logits into some loss like nn.BCEWithLogitsLoss(), you may need to reshape the input of logits into [batch_size * seq_len], which can be done by
return logits[-1]