Could you change
tY = autograd.Variable(torch.cuda.FloatTensor(Y.astype("uint8")), requires_grad=False)

to
tY = autograd.Variable(torch.cuda.FloatTensor(Y.astype(np.float32)), requires_grad=False)

and run it again?