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


            path: The filepath of the model.
            **kwargs: Arguments passed to torch.save method.
        """
        if self.cuda is not False:
            // 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.

        Parameters:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

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: 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


Project Name: opencv/opencv_extra
Commit Name: 27fa67fb71d85b3d09843a62bfbc18297d33c3ab
Time: 2017-09-15
Author: dmitry.kurtaev+github@gmail.com
File Name: testdata/dnn/tensorflow/generate_tf_models.py
Class Name:
Method Name: writeBlob