alpaca/alpacka/data/ops.py
def is_last_level(x):
    """Returns whether pytree is at the last level (children are leaves)."""
    if _is_leaf(x):
        return False
    if isinstance(x, dict):
        vs = x.values()
    else:
        vs = x
    return all(map(_is_leaf, vs))
Returns whether pytree is at the last level (children are leaves).
Returns whether pytree is at the last level (children are leaves).
Returns whether pytree is at the last level ( children are leaves ) .
def is_last_level(x):
    if _is_leaf(x):
        return False
    if isinstance(x, dict):
        vs = x.values()
    else:
        vs = x
    return all(map(_is_leaf, vs))
def is_last_level ( x ) : if _is_leaf ( x ) : return False if isinstance ( x , dict ) : vs = x . values ( ) else : vs = x return all ( map ( _is_leaf , vs ) )
Returns whether pytree is at the last level (children are leaves).
Returns whether pytree is at the last level ( children are leaves ) .
"""Returns whether pytree is at the last level (children are leaves)."""
x