dc832101a57afe93706ce85cc90f476645be6d37,pycox/models/base.py,BaseModel,_predict_func_numpy,#BaseModel#,63

Before Change


        with torch.no_grad():
            dataset = NumpyTensorDataset(X)
            dataloader = DataLoaderSlice(dataset, batch_size)
            preds = [func(x.to(self.device)) for x in iter(dataloader)]
            preds = torch.cat(preds)
        if eval_:
            func.train()

        if return_numpy:
            return preds.numpy()
        return preds

    def save_model_weights(self, path, **kwargs):
        """Save the model weights.

After Change


        """
        dataset = NumpyTensorDataset(X)
        dataloader = DataLoaderSlice(dataset, batch_size)
        return self._predict_func_dataloader(func, dataloader, return_numpy, eval_)
        // if eval_:
        //     func.eval()
        // with torch.no_grad():
        //     dataset = NumpyTensorDataset(X)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: havakv/pycox
Commit Name: dc832101a57afe93706ce85cc90f476645be6d37
Time: 2018-06-11
Author: havard@DN0a22c98f.SUNet
File Name: pycox/models/base.py
Class Name: BaseModel
Method Name: _predict_func_numpy


Project Name: openml/openml-python
Commit Name: 6c00e23c0ebb2a93cf06c840d392b66e67a6e3a3
Time: 2019-04-16
Author: p.gijsbers@tue.nl
File Name: openml/utils.py
Class Name:
Method Name: thread_safe_if_oslo_installed


Project Name: riga/tfdeploy
Commit Name: 20ea228773616f824fa5099d0a6e51b7f829d094
Time: 2016-03-10
Author: marcelrieger@me.com
File Name: tfdeploy.py
Class Name: Operation
Method Name: eval