Hello,
Is creating an optimizer by passing only a subset of model’s parameters:
weight_matrix = list(model.parameters())[0]
optim = Adam([weight_matrix])

equivalent to setting the rest of the parameters’ requires_grad flag to False?
for i,param in enumerate(model.parameters()):
    if i != 0:
        param.requires_grad = False
optim = Adam(model.parameters())

What I can think of is that the second method prevents the gradients from being computed at all, while the first method merely prevents them from being updated. Is this correct, or are there no/other differences?
Thanks!