google / flax

Flax is a neural network library for JAX that is designed for flexibility.
https://flax.readthedocs.io
Apache License 2.0
5.8k stars 613 forks source link

Allow metadata pass-through in flax.struct.field #4056

Open cool-RR opened 5 days ago

cool-RR commented 5 days ago

What does this PR do?

Allows passing through metadata when creating a flax.struct.field. This is useful when you want to add some metadata to your field to be read later.

Checklist

cool-RR commented 3 hours ago

@IvyZX Pushed a test, let me know if anything else is needed.

codecov-commenter commented 3 hours ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (31adb00) to head (62b15bf). Report is 78 commits behind head on main.

Files Patch % Lines
flax/struct.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #4056 +/- ## ====================================== Coverage 0.00% 0.00% ====================================== Files 106 107 +1 Lines 13582 13824 +242 ====================================== - Misses 13582 13824 +242 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.