thanks for your reply.but even I followed your suggestion to cast the type,it seems the error is still there.
My usage is :
x,y=torch.from_numpy(x),torch.from_numpy(y)
x,y=x.type(torch.DoubleTensor),y.type(torch.DoubleTensor)
x=torch.unsqueeze(x,1)
x, y = Variable(x.cuda()), Variable(y.cuda())
preds=model(x)

Although I use print(x.type) before preds=model(x) ,and showed the type of x is torch.cuda.DoubleTensor,but the error RuntimeError: expected Double tensor (got Float tensor) appered every time.
Can you give me some suggestions? Thank you!