def wrapper(*args, **kw):
    flat_args = tree_util.tree_leaves(args)
    if (inexact and (not any((jnp.issubdtype(jnp.result_type(x), jnp.inexact) for x in flat_args)))):
        dtype = jnp.result_type(jnp.float_, *flat_args)
    else:
        dtype = jnp.result_type(*flat_args)
    args = tree_util.tree_map((lambda a: onp.asarray(a, dtype)), args)
    return fun(*args, **kw)
def wrapper(*args, **kw):
    flat_args = tree_util.tree_leaves(args)
    if (inexact and (not any((jnp.issubdtype(jnp.result_type(x), jnp.inexact) for x in flat_args)))):
        dtype = jnp.result_type(jnp.float_, *flat_args)
    else:
        dtype = jnp.result_type(*flat_args)
    args = tree_util.tree_map((lambda a: onp.asarray(a, dtype)), args)
    return fun(*args, **kw)