@alan_ayu: Is the error really on those lines?
Can you paste a small test case + the actual error?
My experience is that expected Double got Float appears when you try to use NLLLoss or CrossEntropyLoss as to cover all int32, float64 is needed.
Furthermore unless you have a Tesla card, you shouldn’t use DoubleTensor for your X, it’s 32 times slower than float32 on GeForce, Quadro and Titan cards on any recent cards ( Maxwell and Pascal so since 2014).