Hi! thanks for your reply, I add it before the net,
it’s now:

mrimgs1 = mrimgs1.to(device)
ctimgs1 = ctimgs1. to(device)
out = net(mrimgs1)
gdlloss = gdl_loss()
gg = gdlloss(out,ctimgs1)

but the result is now:
RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same