You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adjust _pre_load_state_dict_hook to skip excluded tensors (#3208)
Summary:
Pull Request resolved: #3208
For more context please refer to S539698
We see key errors when calling `_pre_load_state_dict_hook`. Upon code inspection, we see the following pattern, a dictionary key is manually constructed (https://fburl.com/code/kg6b1y97), and then code directly calls `state_dict[key]`, without checking if a key is in the state dict.
With this change we skip keys that are not in state dict, which avoid keyerror
Reviewed By: iamzainhuda
Differential Revision: D78511161
fbshipit-source-id: 2fa5cc6ef04ecfad15ecfec6731ef3ed5579e3ec
0 commit comments