I tried the JS loss as well. but for all types it gave me same error. After detach I used Variable and requires_grad too. How is it possible non of them work! and give same error
        MSECMBSS=jensenshannon(ddFake.detach().numpy(),ddGaussy.detach().numpy())**2
       loss2=Variable(MSECMBSS,requires_grad=True)

orr
  loss = SamplesLoss(loss="sinkhorn", p=1, blur=.5)
        ccc=fake.cpu().squeeze(1).view(-1,81)
        ccc1=Gaussy.cpu().squeeze(1).view(-1,81)

        L1=geomloss.SamplesLoss()(ccc.unsqueeze(2),ccc1.unsqueeze(2))
        MSECMBSS=L1.sum().item()
        loss2=Variable(torch.tensor(MSECMBSS),requires_grad=True)