60a673adc4cb179c6f2103045d87dc8adac209f9,chainer_chemistry/models/prediction/regressor.py,Regressor,_convert_to_scalar,#Regressor#Any#,70

Before Change


        Converts an input value to a scalar if its type is a numpy or cupy
        array, otherwise it returns the value as it is.
        
        if type(value) == cupy.core.core.ndarray:
            value = cuda.to_cpu(value)
        if type(value) == numpy.array:
            return numpy.asscalar(value)

After Change


        Converts an input value to a scalar if its type is a numpy or cupy
        array, otherwise it returns the value as it is.
        
        if numpy.isscalar(value):
            return value
        if type(value) is not numpy.array:
            value = cuda.to_cpu(value)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pfnet-research/chainer-chemistry
Commit Name: 60a673adc4cb179c6f2103045d87dc8adac209f9
Time: 2018-12-07
Author: mihaimorariu@gmail.com
File Name: chainer_chemistry/models/prediction/regressor.py
Class Name: Regressor
Method Name: _convert_to_scalar


Project Name: pfnet-research/chainer-chemistry
Commit Name: 60a673adc4cb179c6f2103045d87dc8adac209f9
Time: 2018-12-07
Author: mihaimorariu@gmail.com
File Name: chainer_chemistry/models/prediction/classifier.py
Class Name: Classifier
Method Name: _convert_to_scalar


Project Name: prody/ProDy
Commit Name: 895a75cf5c5a91dec4fb2ac1bb8833182a65be85
Time: 2018-04-17
Author: shz66@pitt.edu
File Name: prody/dynamics/anm.py
Class Name: ANMBase
Method Name: getMechStiffStatistic