参考 state_dict - 云+社区 - 腾讯云
(Python method, in Module)
state_dict
(destination=None, prefix='', keep_vars=False)[source]
返回一个包含整个模型状态的字典。包含参数和现在的缓冲器(例如,运行平均值)。键对应着参数和缓冲器的名字。
返回值:
- 包含整个模型的字典。
a dictionary containing a whole state of the module
例:
>>> module.state_dict().keys()
['bias', 'weight']