def inner_loop(i, arr, out):

    def cond_fun(state):
        (i, j, _, _) = state
        return lax.le(j, i)

    def body_fun(state):
        (i, j, arr, out) = state
        arr_i = lax.dynamic_index_in_dim(arr, i, 0, False)
        arr_i_j = lax.dynamic_index_in_dim(arr_i, j, 0, False)
        out = update_entry(out, arr_i_j, i, j)
        return (i, lax.add(j, 1), arr, out)
    init_val = (i, 0, arr, out)
    (_, _, _, out) = lax.while_loop(cond_fun, body_fun, init_val)
    return out
def inner_loop(i, arr, out):

    def cond_fun(state):
        (i, j, _, _) = state
        return lax.le(j, i)

    def body_fun(state):
        (i, j, arr, out) = state
        arr_i = lax.dynamic_index_in_dim(arr, i, 0, False)
        arr_i_j = lax.dynamic_index_in_dim(arr_i, j, 0, False)
        out = update_entry(out, arr_i_j, i, j)
        return (i, lax.add(j, 1), arr, out)
    init_val = (i, 0, arr, out)
    (_, _, _, out) = lax.while_loop(cond_fun, body_fun, init_val)
    return out