Would something like this do?

    y_true = [[1, 1], [1, 1]] 
    y_pred = [[1, 1], [1, 1]]
    assert array_equal(r2_score(y_true, y_pred, average=None), np.array([1.], [1.]))