Guideline for using `static_fields`?
See original GitHub issueHi,
Most of the nn.Modules
(MLP) use static_fields
for, well seemingly static attributes. In the documentation it is stated that static_field
should be used rarely. Is there a do’s and don’ts for their usage? As I understand these can be filtered out with *filter
calls.
Thanks.
Issue Analytics
- State:
- Created a year ago
- Comments:14 (13 by maintainers)
Top Results From Across the Web
How Static Fields in Java Work - ThoughtCo
In Java, fields can be shared across all objects of the same type through the use of the static modifier. Learn through these...
Read more >A Guide to the Static Keyword in Java - Baeldung
Learn about Java static fields, static methods, static blocks and static inner classes.
Read more >LCK05-J. Synchronize access to static fields that can be
I labeled this guideline as "untrusted" to indicate it deals with issues related to integrating with untrusted code. Consequently, anything to do with ......
Read more >Safety of human MRI at static fields above the FDA 8 T guideline
Purpose: To assess whether exposure to a 9.4 T static magnetic field during sodium imaging at 105.92 MHz affects human vital signs and...
Read more >Dosimetry of Small Static Fields Used in External Beam ...
Guidelines for its practical implementation using suitable detectors and methods for the determination of field output factors are given for specific ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t worry, it definitely isn’t going away. If nothing else it’s a key part of how things work internally.
On balance I think I’m inclined to maintain the status quo. This clearly does break a couple of tests, and whilst they’re pretty minor it’s not encouraging. To rebut the argument (my argument) in favour of not using
static_field
: if an end-user overzealously applies astatic_field
then I don’t think it should actually matter – you can’t smuggle in JAX arrays this way as they’re not hashable. So extrastatic_field
s should never break you silently.The more I am interacting with equinox <=> jax/optax I am thinking having
static_fields()
is not that bad to have as default. Saves the trouble of repeating filtering at places.