f3dabcf2c16d8ba0c702b18c9fccb633fa8b90d5,pycox/torch_fitter.py,FitNet,save_model_weights,#FitNet#,99
Before Change
path: The filepath of the model.
**kwargs: Arguments passed to torch.save method.
"""
torch.save(self.net.state_dict(), path, **kwargs)
def load_model_weights(self, path, **kwargs):
"""Load model weights.
After Change
// If we don"t do this, torch will move g to default gpu.
// Remove this when bug is fixed...
self.net.cpu()
torch.save(self.net.state_dict(), path, **kwargs)
to_cuda(self.net, self.cuda)
else:
torch.save(self.net.state_dict(), path, **kwargs)
def load_model_weights(self, path, **kwargs):
"""Load model weights.
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances Project Name: havakv/pycox
Commit Name: f3dabcf2c16d8ba0c702b18c9fccb633fa8b90d5
Time: 2018-04-25
Author: kvamme@samba8.ad.nr.no
File Name: pycox/torch_fitter.py
Class Name: FitNet
Method Name: save_model_weights
Project Name: richzhang/colorization-pytorch
Commit Name: e2b72f5da0a45f9bc81fd7f926a1a6205bb3b182
Time: 2018-04-24
Author: junyanzhu89@gmail.com
File Name: models/base_model.py
Class Name: BaseModel
Method Name: save_networks
Project Name: havakv/pycox
Commit Name: e9e7cba5509f9e4b4863ede4e1f0337c1876e68a
Time: 2018-04-20
Author: kvamme@samba8.ad.nr.no
File Name: pycox/cox.py
Class Name: CoxBase
Method Name: save_model_weights