参考链接: torch.nn.Module.dump_patches
原文及翻译:
dump_patches = False
This allows better BC support for load_state_dict(). In
state_dict(), the version number will be saved as in the attribute _metadata of the
returned state dict, and thus pickled. _metadata is a dictionary with keys that follow
the naming convention of state dict. See _load_from_state_dict on how to use this
information in loading.
这有利于为方法load_state_dict()提供更好的BC支持.在方法state_dict()中,版本数(version number)会
作为返回的状态字典的元数据属性(attribute _metadata)来存储,并且,因此,pickled. _metadata是一个字
典,该字典的关键字遵从状态字典的命名惯例.
If new parameters/buffers are added/removed from a module, this number shall be bumped,
and the module’s _load_from_state_dict method can compare the version number and do
appropriate changes if the state dict is from before the change.
如果新的参数/缓冲被添加到/移除出一个模块中,这个数字将会冲突,并且模块的_load_from_state_dict方法
可以比较版本数(version number)并且如果状态字典来自于修改之前的话,该方法将做出适当的修改.