You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the @PropertyInfo is omitted both MLXArray and MLXArray? should still appear and be updatable as properties using the actual property name.
See ModuleTests, in particular ChildTestModule and TestModule. Also testTupleParameters is a more direct test of this (though more a more convoluted case).
You mentioned:
Bias parameters in RNN, GRU, and LSTM were not loadable from saved weights
I am not opposed to adding the property wrappers, but I wonder what is going on such that they wouldn't load -- can you give repro steps?
Sorry, that was a misunderstanding on my part. @ParameterInfo doesn't need to be added where keys don't need to be remapped. The remaining changes are just for consistency: RNN's bias now uses let like other layers, and hiddenSize is exposed on all three classes, mirroring the Python API.
DePasqualeOrg
changed the title
Add @ParameterInfo to recurrent layer bias parameters
Improve consistency in recurrent layers
Dec 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Bias parameters in RNN, GRU, and LSTM were not loadable from saved weights because they lacked the@ParameterInfoattribute.Changes:- RNN: Add@ParameterInfotobias, addhiddenSizeproperty- GRU: Add@ParameterInfotobandbhn- LSTM: Add@ParameterInfotobias, addhiddenSizepropertyThis aligns with the Python API, where bias parameters are automatically registered as loadable module parameters.Edit: Corrected below
Checklist
pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes