'Check if K.logsumexp works properly for values close to one.'

@pytest.mark.parametrize('x_np,axis,keepdims', [(np.array([1.1, 0.8, 0.9]), 0, False), (np.array([[1.1, 0.8, 0.9]]), 0, False), (np.array([[1.1, 0.8, 0.9]]), 1, False), (np.array([[1.1, 0.8, 0.9]]), (-1), False), (np.array([[1.1, 0.8, 0.9]]), 1, True), (np.array([[1.1], [1.2]]), 0, False), (np.array([[1.1], [1.2]]), 1, False), (np.array([[1.1], [1.2]]), (-1), False), (np.array([[1.1], [1.2]]), (-1), True), (np.array([[1.1, 1.2, 1.3], [0.9, 0.7, 1.4]]), None, False), (np.array([[1.1, 1.2, 1.3], [0.9, 0.7, 1.4]]), 0, False), (np.array([[1.1, 1.2, 1.3], [0.9, 0.7, 1.4]]), 1, False), (np.array([[1.1, 1.2, 1.3], [0.9, 0.7, 1.4]]), (-1), False)])
def test_logsumexp(self, x_np, axis, keepdims):

    for k in BACKENDS:
        x = k.variable(x_np)
        assert_allclose(k.eval(k.logsumexp(x, axis=axis, keepdims=keepdims)), np.log(np.sum(np.exp(x_np), axis=axis, keepdims=keepdims)), rtol=1e-05)
