Skip to content

Commit

Permalink
tree_flatten supports subclasses of tuple (named tuples)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Alshaarawy committed Nov 18, 2024
1 parent 11a32a4 commit b99603d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions thunder/core/pytree.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def tree_flatten(args, namespace=OPTREE_NAMESPACE):
torch.autograd.function.FunctionCtx,
}
and not isinstance(args, (ProxyInterface))
and not isinstance(args, tuple)
and not dataclasses.is_dataclass(args)
and not type(args).__module__.startswith("torch.return_types")
):
Expand Down

0 comments on commit b99603d

Please sign in to comment.