Hi, I have a model (nn.Module with multiple nested nn.Module as variable). I want to get all its parameter in a 1D vector and perform some operations on it, without changing length and put the result back into model as new parameters.
For getting parameter I am thinking of something like
                all_param = []
                for param in model.parameters():
                    all_param.append(param.view(-1))
                vec = torch.cat(all_param, dim=0)
                # do some operations on vec
                # ? put vec back into model.

I am looking into state dictionary to put back, but there can be nested module in model, so like parameters() just follows an ordered traversal over nesting, can I use it to update Module also or is there a shorter way to do so?