Well yes I am using nn.BCELoss(), but it seems to call binary_cross_entropy as in the error list there is :

  File "C:\Users\gueganj\Miniconda3\envs\pytorch_env\lib\site-packages\torch\nn\modules\loss.py", line 529, in forward
    return F.binary_cross_entropy(input, target, weight=self.weight, reduction=self.reduction)

  File "C:\Users\gueganj\Miniconda3\envs\pytorch_env\lib\site-packages\torch\nn\functional.py", line 2484, in binary_cross_entropy
    input, target, weight, reduction_enum)

RuntimeError: Found dtype Float but expected Long

Actually, I am not really sure to understand the difference between using nn or functionnal, Is there any subtleties to know here to make it work ?
Also note that output for the dtype of my tensors are torch.int64