def METHOD_NAME(self, x, y, atol_diag, atol_offdiag):
    """Assert that all elements x_ij, y_ij are close with
    different absolute tolerances for on- and off-diagonal elements.
    """
    assert x.shape == y.shape
    n = min(x.shape)
    mask_offdiag = ~np.identity(n, dtype=bool)
    np.testing.assert_allclose(np.diag(x), np.diag(y), atol=atol_diag)
    np.testing.assert_allclose(
        x[mask_offdiag],
        y[mask_offdiag],
        atol=atol_offdiag)