86cff17e7ef1b355e1ab4862ccd664ed4c856227,python/ray/util/sgd/torch/torch_trainer.py,TorchTrainer,get_model,#TorchTrainer#,498
Before Change
def get_model(self):
Returns the learned model(s).
models = self.model_creator(self.config)
state = self.local_worker.get_state()
if len(state["models"]) == 1:
models.load_state_dict(state["models"][0])
else:
for model, state_dict in zip(models, state["models"]):
After Change
Returns the learned model(s).
unwrapped = []
for model in self.local_worker.models:
unwrapped += [model.module if hasattr(model, "module") else model]
if len(unwrapped) == 1:
return unwrapped[0]
return unwrapped
def state_dict(self):
return self.local_worker.state_dict()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: ray-project/ray
Commit Name: 86cff17e7ef1b355e1ab4862ccd664ed4c856227
Time: 2020-03-30
Author: rliaw@berkeley.edu
File Name: python/ray/util/sgd/torch/torch_trainer.py
Class Name: TorchTrainer
Method Name: get_model
Project Name: VOLTTRON/volttron
Commit Name: 694383ee05139068146f021d19f80143f98011f6
Time: 2020-06-01
Author: james.larson@pnnl.gov
File Name: services/core/MasterDriverAgent/master_driver/interfaces/ecobee.py
Class Name: Interface
Method Name: _scrape_all
Project Name: VOLTTRON/volttron
Commit Name: 13cb16b9edbb868505c41401dc951a8c8accb396
Time: 2020-06-22
Author: james.larson@pnnl.gov
File Name: services/core/MasterDriverAgent/master_driver/interfaces/ecobee.py
Class Name: Interface
Method Name: _scrape_all