Skip to content

What is replace in TrainState #2042

Answered by marcvanzee
pablo2909 asked this question in Q&A
Discussion options

You must be logged in to vote

PyTreeNode implements the init_subclass method, which will converts the subclass (in this case TrainState) into a Flax dataclass, which does implement the replace method.

We inherit from PyTreeNode to avoid type checking issues when using pytype.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by marcvanzee
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2041 on April 11, 2022 10:01.