add ckpt code example

This commit is contained in:
changzherui 2020-10-23 07:55:03 +08:00
parent e805051c1f
commit d6902ca5ae
1 changed files with 5 additions and 0 deletions

View File

@ -341,6 +341,11 @@ def load_param_into_net(net, parameter_dict, strict_load=False):
Raises:
TypeError: Argument is not a Cell, or parameter_dict is not a Parameter dictionary.
Examples:
>>> net = LeNet5()
>>> param_dict = load_checkpoint("LeNet5-2_1875.ckpt")
>>> load_param_into_net(net, param_dict)
"""
if not isinstance(net, nn.Cell):
logger.error("Failed to combine the net and the parameters.")