3ce15cf0b1b83503d0a35a0077cb93322c2cc710,finetune/base.py,BaseModel,_inference,#BaseModel#Any#Any#,239

Before Change


    def _inference(self, Xs, mode=None):
        self._data = list(self.input_pipeline._format_for_inference(Xs))
        self._closed = False
        n = len(self._data)

        if not getattr(self, "estimator", None):
            self.estimator = self.get_estimator()
            self._input_fn = lambda: self.input_pipeline._dataset_without_targets(
                self._data_generator, train=None
            ).batch(self.config.batch_size)
            self._predictions = self.estimator.predict(input_fn=self._input_fn)

        predictions = [None] * n
        for i in range(n):
            y = next(self._predictions)
            y = y[mode] if mode else y
            predictions[i] = y
        return predictions
        
    def fit(self, *args, **kwargs):
         An alias for finetune. 

After Change


        else:
            estimator = self.get_estimator()
            input_fn = self.input_pipeline.get_predict_input_fn(Xs)
            length = len(Xs) if not callable(Xs) else None

            predictions = tqdm.tqdm(
                estimator.predict(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: IndicoDataSolutions/finetune
Commit Name: 3ce15cf0b1b83503d0a35a0077cb93322c2cc710
Time: 2018-11-13
Author: madison@indico.io
File Name: finetune/base.py
Class Name: BaseModel
Method Name: _inference


Project Name: analysiscenter/batchflow
Commit Name: 9bb40b524d8de503f6368e1229367edaca0330f5
Time: 2019-11-22
Author: Tsimfer.SA@gazprom-neft.ru
File Name: batchflow/models/eager_torch/layers/resize.py
Class Name: Combine
Method Name: forward


Project Name: rtqichen/torchdiffeq
Commit Name: bcec059159d3799fac85bbbcb0e94c1b8214780c
Time: 2021-01-06
Author: rtqichen@gmail.com
File Name: torchdiffeq/_impl/adjoint.py
Class Name:
Method Name: odeint_adjoint