Your example output seems to be a binary classification output, so you could use nn.BCELoss after applying sigmoid on your output.
However, to get more numerical stability I would recommend to let the model return raw logits and use nn.BCEWithLogits instead. This will also give you the ability to set the pos_weight to counter the effect of the imbalanced dataset.