2f1905529d25e62179850aa222f65ed685ff682f,foolbox/ext/native/models/base.py,ModelWithPreprocessing,__call__,#ModelWithPreprocessing#Any#,76

Before Change



    def __call__(self, inputs):
        inputs, restore = wrap(inputs)
        x = inputs
        x = self._preprocess(x)
        x = ep.astensor(self._model(x.tensor))
        return restore(x)

    def transform_bounds(self, bounds, inplace=False):
        Returns a new model with the desired bounds and updates the preprocessing accordingly
        // more efficient than the base class implementation because it avoids the additional wrapper

After Change


        return self._dummy

    def __call__(self, inputs: T) -> T:
        x, restore_type = ep.astensor_(inputs)
        y = self._preprocess(x)
        z = ep.astensor(self._model(y.raw))
        return restore_type(z)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: bethgelab/foolbox
Commit Name: 2f1905529d25e62179850aa222f65ed685ff682f
Time: 2020-01-31
Author: git@jonasrauber.de
File Name: foolbox/ext/native/models/base.py
Class Name: ModelWithPreprocessing
Method Name: __call__


Project Name: googledatalab/pydatalab
Commit Name: 15a86d278c6b0f8574cdd6e237f778faf2e002e1
Time: 2017-02-27
Author: qimingj@users.noreply.github.com
File Name: solutionbox/inception/datalab_solutions/inception/_predictor.py
Class Name: PredictBatchDoFn
Method Name: start_bundle


Project Name: uber/ludwig
Commit Name: 116e474be75cdcf4c1d53b1c6540097766671b18
Time: 2020-03-27
Author: jimthompson5802@aol.com
File Name: ludwig/models/model.py
Class Name: Model
Method Name: predict


Project Name: bethgelab/foolbox
Commit Name: 2f1905529d25e62179850aa222f65ed685ff682f
Time: 2020-01-31
Author: git@jonasrauber.de
File Name: foolbox/ext/native/models/base.py
Class Name: TransformBoundsWrapper
Method Name: __call__