Is Module.parent part of the public Flax API? #1212
Answered
by
marcvanzee
marcvanzee
asked this question in
Q&A
-
Original question asked by @johnpjf. |
Beta Was this translation helpful? Give feedback.
Answered by
marcvanzee
Apr 8, 2021
Replies: 1 comment
-
Answer by @levskaya:
you can even do weird things like overriding what a module's parent is at instantiation so it's definitely a core, public part of the API, even if we don't advertise it much. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
marcvanzee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.