Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Mar 30, 2024
1 parent 0f11cb0 commit 8cd078d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sepes/_src/tree_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def construct_tree(
return root


def value_and_tree(func, argnums: int | Sequence[int] = 0):
def value_and_tree(func: Callable[..., T], argnums: int | Sequence[int] = 0):
"""Call a function on copied input argument and return the value and the tree.
Input arguments are copied before calling the function, and the argument
Expand Down Expand Up @@ -590,7 +590,7 @@ def immutate_is_leaf(node):
return False

@ft.wraps(func)
def stateless_func(*args, **kwargs) -> tuple[Any, PyTree | tuple[PyTree, ...]]:
def stateless_func(*args, **kwargs) -> tuple[T, PyTree | tuple[PyTree, ...]]:
# copy the incoming inputs
(args, kwargs) = tree_copy((args, kwargs))
# and edit the node/record to make it mutable (if there is a rule for it)
Expand Down

0 comments on commit 8cd078d

Please sign in to comment.