New attribute self._load_hook
in linear class since 2.03 will raise KeyError when executing load_state_dict
fucntion
#5080
Labels
🐛 Describe the bug
In Pytorch, the function
load_state_dict(state_dict, strict)
allows empty dictstate_dict=={}
whenstrict
is False.However, from version 2.03 the linear class in
torch_geometric.nn.dense.linear.py
has a new attributeself._load_hook
, and when we executeLinear(xxxx).load_state_dict({}, strict=False)
, the linear class will execute theself._lazy_load_hook
function as followsSince the
state_dict
is empty, the lineweight = state_dict[prefix + 'weight']
will report KeyError.Environment
conda
,pip
, source):torch-scatter
):The text was updated successfully, but these errors were encountered: