def _reshape_G(G):
    """From a correlation matrix of size
    nsrc X nsrc X nchan X nchan X filters_len X filters_len,
    creates a new one of size
    nsrc*nchan*filters_len X nsrc*nchan*filters_len"""
    G = np.moveaxis(G, (1, 3), (3, 4))
    (nsrc, nchan, filters_len) = G.shape[0:3]
    G = np.reshape(
        G, (nsrc * nchan * filters_len, nsrc * nchan * filters_len)
    )
    return G
From a correlation matrix of size
    nsrc X nsrc X nchan X nchan X filters_len X filters_len,
    creates a new one of size
    nsrc*nchan*filters_len X nsrc*nchan*filters_len