Solved by ptrblck in post #2 
              
              
                The to() operation is not an inplace operation on tensors, so you would need to reassign normeddata: 
normeddata = normeddata.to(DEVICE)