ef7707947b85d141e955e844ec1800df9eddb5c2,scipy/linalg/blas.py,,find_best_blas_type,#Any#Any#,236

Before Change


        dtypes = [ar.dtype for ar in arrays]
        dtype = _np.find_common_type(dtypes, ())
        try:
            index = dtypes.index(dtype)
        except ValueError:
            index = 0
        if arrays[index].flags["FORTRAN"]:
            // prefer Fortran for leading array with column major order

After Change


        // use the most generic type in arrays
        chars = [arr.dtype.char for arr in arrays]
        scores = [_type_score.get(x, 5) for x in chars]
        max_score = max(scores)
        ind_max_score = scores.index(max_score)
        // safe upcasting for mix of float64 and complex64 --> prefix "z"
        if max_score == 3 and (2 in scores):
            max_score = 4

        if arrays[ind_max_score].flags["FORTRAN"]:
            // prefer Fortran for leading array with column major order
            prefer_fortran = True

    // Get the LAPACK prefix and the corresponding dtype if not fall back
    // to "d" and double precision float.
    prefix, dtype = _type_conv.get(max_score, ("d", _np.dtype("float64")))

    return prefix, dtype, prefer_fortran

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: scipy/scipy
Commit Name: ef7707947b85d141e955e844ec1800df9eddb5c2
Time: 2018-12-26
Author: ilhanpolat@gmail.com
File Name: scipy/linalg/blas.py
Class Name:
Method Name: find_best_blas_type


Project Name: geomstats/geomstats
Commit Name: 6a534c44a8af152d38d833c370695e54ff1dfa20
Time: 2020-05-06
Author: ninamio78@gmail.com
File Name: geomstats/_backend/numpy/__init__.py
Class Name:
Method Name: convert_to_wider_dtype


Project Name: geomstats/geomstats
Commit Name: bcb31499b3bab0b31e7f45c38e77571fa6ccb0c1
Time: 2020-05-06
Author: ninamio78@gmail.com
File Name: geomstats/_backend/tensorflow/__init__.py
Class Name:
Method Name: convert_to_wider_dtype


Project Name: mil-tokyo/webdnn
Commit Name: 35ef266b72aba775f4f6cd9a47519b6bebae07e4
Time: 2018-01-25
Author: y.kikura@gmail.com
File Name: src/graph_transpiler/webdnn/graph/variable.py
Class Name: Variable
Method Name: combine_axes


Project Name: merenlab/anvio
Commit Name: 2be6f9614d7a11ea88283ce1b4ad363d10c133c2
Time: 2019-08-13
Author: quentin.clayssen@gmail.com
File Name: anvio/taxoestimation.py
Class Name: SCGsTaxomy
Method Name: make_list_taxonomy