While @Nikronic’s post is true for tensors (and parameters), the to(), cuda(), and cpu() calls will be executed recursively on all parameters and buffers inside an nn.Module, so you don’t have to re-assign your model:
model = nn.Linear(1, 1)
print(model.weight.device)
> cpu
model.cuda()
print(model.weight.device)
> cuda:0

x = torch.randn(1)
print(x.device)
> cpu
x.cuda() # ERROR!!!
print(x.device)
> cpu