Properly update _flat_weights in RNN models (#32989)
Summary:
Resubmitting https://github.com/pytorch/pytorch/issues/32939
Should fix https://github.com/pytorch/pytorch/issues/32346 hopefully. Now when _flat_weights list is updated, None elements are appended to it if some weights are missing, subsequent setattr calls for the missing weights should repair _flat_weights and make it suitable to use in the backend.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32989
Differential Revision: D19731952
Pulled By: ngimel
fbshipit-source-id: 2118a19840491e7ab0fef15185fad982f42795a6
Author
Natalia Gimelshein