oneflow.nn.Graph.load_state_dict¶
-
Graph.load_state_dict(state_dict: Dict[str, Union[Dict[str, oneflow.Tensor], oneflow.Tensor]], strict: bool = True)¶ Copies module’s states and other graph states from
state_dictinto this graph. IfstrictisTrue, then the keys ofstate_dictmust exactly match the keys returned by this module’snn.Graph.state_dict()function.- Parameters
state_dict (dict) – a dict containing module’s states and other graph states.
strict (bool, optional) – whether to strictly enforce that the keys in
state_dictmatch the keys returned by this graph’snn.Graph.state_dict()function. Default:True.
Note
nn.Graph’s state dict can only be loaded before the first call of a graph.