Replies: 1 comment
-
Flax Modules are Python 3.7 dataclasses, which allows us to define the parameters this way. For more information, please see our documentation: https://flax.readthedocs.io/en/latest/flax.linen.html#flax.linen.Module |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All! Happy to be part of community.
I have been using Flax for some time and there is one part that I am wondering how Flax implemented in Python.
The thing is when I write:
`class NN(nn.Module):
features: Sequence[int]
def setup(self):
self.layers = [nn.Dense(feat) for feat in self.features]
then I can write
NN(features=[1, 3, 4] )
`
but it does not happen with Python usual classes. I am wondering how such a thing happens when we use nn.Module as a parent?
Beta Was this translation helpful? Give feedback.
All reactions