86cff17e7ef1b355e1ab4862ccd664ed4c856227,python/ray/util/sgd/torch/distributed_torch_runner.py,DistributedTorchRunner,_get_model_state_dicts,#DistributedTorchRunner#,140

Before Change


            // This is so that we create a duplicate of weights into CPU rather
            // than move the model weights out of the GPU so that we can
            // resume training while saving intermediate checkpoints.
            cpu_state_dicts += [{k: v.cpu() for k, v in state_dict.items()}]
        return cpu_state_dicts

    def _set_model_state_dicts(self, model_state_dicts):
        for model, model_state_dict in zip(self.models, model_state_dicts):
            model.module.load_state_dict(model_state_dict)

After Change



        This is needed for PyTorch DistributedDataParallel models.
        
        return [model.module.state_dict() for model in self.models]

    def _set_model_state_dicts(self, model_state_dicts):
        for model, model_state_dict in zip(self.models, model_state_dicts):
            model.module.load_state_dict(model_state_dict)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: ray-project/ray
Commit Name: 86cff17e7ef1b355e1ab4862ccd664ed4c856227
Time: 2020-03-30
Author: rliaw@berkeley.edu
File Name: python/ray/util/sgd/torch/distributed_torch_runner.py
Class Name: DistributedTorchRunner
Method Name: _get_model_state_dicts


Project Name: ray-project/ray
Commit Name: 86cff17e7ef1b355e1ab4862ccd664ed4c856227
Time: 2020-03-30
Author: rliaw@berkeley.edu
File Name: python/ray/util/sgd/torch/torch_runner.py
Class Name: TorchRunner
Method Name: _get_model_state_dicts


Project Name: dmlc/gluon-nlp
Commit Name: 8859c20eb97e803f66487c74615350b955efab4a
Time: 2018-06-30
Author: leonard@lausen.nl
File Name: gluonnlp/embedding/evaluation.py
Class Name:
Method Name: list_evaluation_functions