My problem has just solved.
I mention it here, maybe it will help the others.
I used model.parameters() in optimizer = torch.optim.SGD(model.parameters(), lr=x, momentum=y) and now it returns False (before that I did not mention the model name correctly).