question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Guideline for using `static_fields`?

See original GitHub issue

Hi,

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:open
  • Created a year ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
patrick-kidgercommented, Jul 28, 2022

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 a static_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 extra static_fields should never break you silently.

0reactions
paganpastacommented, Jul 29, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found