I used the following:

def bhatta_loss(output,target):
out = -torch.log(torch.sum(torch.sqrt(torch.abs(torch.mul(output, target)))))
return  out

backward works but I get nan after the first iteration 
Any ideas ?