Hi @DK13,
You can try something like
params = [p for p in model.parameters()]
params.append(w)
optim = torch.optim.Adam(params)

This is without moving the tensors to cuda but just move them before you pass them to the optimizer and all should work!