Does it matter if I create optimizer before or after uploading the model in GPU. For example
model = myModel()
optimizer = torch.optim.Adamax(model.parameters())
model = model.to(device)

vs.
model = myModel()
model = model.to(device)
optimizer = torch.optim.Adamax(model.parameters())

Thanks,
Abhidip