Thanks for your quick reply @Mazhar_Shaikh! One question though: During my forward pass I have to create several tensors (for example because I produce a grid for transformations). At the moment, I have to send them to the device as well, so that multiplications and additions with the input tensors work. How will this be effected with your code?