Hi @Kartik_Kannapur,
nn.BCEWithLogitsLoss loss function needs one-hot-encoded vector as target. Currently, your target tensor would be in the following format (assuming binary classification):
tensor([1, 0, 0, 1]) # integer encoded

It can be one-hot-encoded in the following manner.
tensor([[0, 1], [1, 0], [1, 0], [0, 1]]) # one-hot encoded