506b234094009d55d326f1ce957f53f15d4b65ee,geomstats/spd_matrices_space.py,,is_symmetric,#Any#Any#,19

Before Change


    Check if a matrix is symmetric.
    if mat.ndim == 2:
        mat = np.expand_dims(mat, axis=0)
    return np.allclose(mat, mat.transpose(axes=(0, 2, 1)), atol=tolerance)


def make_symmetric(mat):
    Make a matrix fully symmetric to avoid numerical issues.

After Change


    assert mat.ndim == 3
    n_mats, _, _ = mat.shape

    mask = np.zeros(n_mats, dtype=bool)
    for i in range(n_mats):
        mask[i] = np.allclose(mat[i], np.transpose(mat[i]),
                              atol=tolerance)

    return mask
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: geomstats/geomstats
Commit Name: 506b234094009d55d326f1ce957f53f15d4b65ee
Time: 2018-02-26
Author: ninamio78@gmail.com
File Name: geomstats/spd_matrices_space.py
Class Name:
Method Name: is_symmetric


Project Name: aleju/imgaug
Commit Name: f22c4ebf74fd00bb8e2ec136ea9cf0f7177ebf61
Time: 2015-07-16
Author: kontakt@ajung.name
File Name: TestImageAugmenter.py
Class Name: TestImageAugmenter
Method Name: test_single_channel


Project Name: aleju/imgaug
Commit Name: 1408b93e1615270242db7c92b8a7a2ab8289f787
Time: 2015-07-10
Author: kontakt@ajung.name
File Name: TestImageAugmenter.py
Class Name: TestImageAugmenter
Method Name: test_scaling