790b9a7f29f19bad21fd3c5c5f91a153ac96f69d,gensim/models/_fasttext_bin.py,,_load_matrix,#Any#Any#,202

Before Change


    num_vectors, dim = _struct_unpack(fin, "@2q")

    float_size = struct.calcsize("@f")
    if float_size == 4:
        dtype = np.dtype(np.float32)
    elif float_size == 8:
        dtype = np.dtype(np.float64)
    else:
        raise ValueError("Incompatible float size: %r" % float_size)

    matrix = np.fromfile(fin, dtype=dtype, count=num_vectors * dim)
    matrix = matrix.reshape((num_vectors, dim))
    return matrix

After Change


    else:
        matrix = np.fromfile(fin, _FLOAT_DTYPE, count)

    assert matrix.shape == (count,), "expected (%r,),  got %r" % (count, matrix.shape)
    matrix = matrix.reshape((num_vectors, dim))
    return matrix

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: RaRe-Technologies/gensim
Commit Name: 790b9a7f29f19bad21fd3c5c5f91a153ac96f69d
Time: 2019-05-05
Author: m@penkov.dev
File Name: gensim/models/_fasttext_bin.py
Class Name:
Method Name: _load_matrix


Project Name: apache/incubator-mxnet
Commit Name: 78d7b1d209c8b5427071d75a9cb8618cf585226b
Time: 2021-04-02
Author: 69359374+barry-jin@users.noreply.github.com
File Name: python/mxnet/ndarray/numpy_extension/_op.py
Class Name:
Method Name: masked_log_softmax


Project Name: RaRe-Technologies/gensim
Commit Name: 790b9a7f29f19bad21fd3c5c5f91a153ac96f69d
Time: 2019-05-05
Author: m@penkov.dev
File Name: gensim/models/_fasttext_bin.py
Class Name:
Method Name: _load_matrix


Project Name: apache/incubator-mxnet
Commit Name: 78d7b1d209c8b5427071d75a9cb8618cf585226b
Time: 2021-04-02
Author: 69359374+barry-jin@users.noreply.github.com
File Name: python/mxnet/ndarray/numpy_extension/_op.py
Class Name:
Method Name: masked_softmax