Even if you do something to force inputs2 to cpu then you cannot do operations with that inputs2 because it becomes torch.FloatTensor and your model parameters will be torch.cuda.FloatTensor which are incompatible