I would stick with .clone, since .detach still uses the same underlying data.
Your inplace unsqueeze_ will therefore also unsqueeze targets:
x = torch.ones(10)
y = x.detach()
y.unsqueeze_(0)
print(x.shape)
> torch.Size([1, 10])
print(y.shape)
> torch.Size([1, 10])

May I ask, why you need the BCELoss?
It doesn’t seem like you have a multi-label setup or are you manipulating the one_hot target somehow afterwards?