def body_fun(i, state):
    (arr, total) = (state['arr'], state['total'])
    arr_i = lax.dynamic_index_in_dim(arr, i, 0, False)
    return {'arr': arr, 'total': lax.add(total, arr_i)}
def body_fun(i, state):
    (arr, total) = (state['arr'], state['total'])
    arr_i = lax.dynamic_index_in_dim(arr, i, 0, False)
    return {'arr': arr, 'total': lax.add(total, arr_i)}