Skip to content

Is Module.parent part of the public Flax API? #1212

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

You must be logged in to vote

Answer by @levskaya:

parent is a key attribute, it's just usually handled automatically as a dynamically scoped variable in the background.

you can even do weird things like overriding what a module's parent is at instantiation MyModule(...., parent=weird_parent) in case you really needed to for closures or something, though I don't think anyone has ever (yet) used that.

so it's definitely a core, public part of the API, even if we don't advertise it much.

Replies: 1 comment

Comment options

marcvanzee
Apr 8, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by marcvanzee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant