Skip to content

Commit

Permalink
Fix _ParentType annotation
Browse files Browse the repository at this point in the history
Fix definition of `_ParentType` so that runtime type checkers work with nested Flax modules.
  • Loading branch information
dcharatan authored Aug 6, 2024
1 parent 5694517 commit 967353f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flax/linen/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -2901,7 +2901,7 @@ def module_paths(
return {'/'.join(row.path): row.module_copy for row in table}


_ParentType = Union[type[Module], Scope, type[_Sentinel], None]
_ParentType = Union[Module, Scope, _Sentinel, None]


def merge_param(name: str, a: T | None, b: T | None) -> T:
Expand Down

0 comments on commit 967353f

Please sign in to comment.