@Konotori  About Arul’s answer, layer is actually a subclass of Module, so it is relevant.
May I ask what variable you missed to append .to(device) to? It seems you already get the input and model on cuda.