I understand but think of the following scenario.
We have a model named net(inputs, targets) taking inputs and targets.
So far so good things are easy we can send net.to(device) and inputs.to(device), targets.to(device) accordingly.
Things start to get hairier when we want to manipulate some aspects of model as shown in the example above in def dummy_func.
Every torch.ones, torch.zeros  whatnot has to be accompanied by .cuda.
Which most of the time will raise errors if we by mistake have at least one tensor that is on cpu and the rest on gpu and vice versa.
I think this defeats the purpose of model.to(device), does’t it?
We would expect that whatever is happening inside the model (whatever ops) to be sent to device, no?