Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-tensor attributes of nn objects are not saved by SaveToNpz/LoadFromNpz #485

Closed
coreylowman opened this issue Feb 24, 2023 · 2 comments · Fixed by #799
Closed

Non-tensor attributes of nn objects are not saved by SaveToNpz/LoadFromNpz #485

coreylowman opened this issue Feb 24, 2023 · 2 comments · Fixed by #799
Labels
bug Something isn't working

Comments

@coreylowman
Copy link
Owner

This is currently affecting:

  • BatchNorm2D::epsilon
  • BatchNorm2D::momentum
  • Dropout::p
  • LayerNorm1D::epsilon
@coreylowman coreylowman added the bug Something isn't working label Feb 24, 2023
@TimerErTim
Copy link
Contributor

Would it be feasable to store those values as scalar tensor instead and let the RecursiveWalker handle the rest upon saving and loading?

@coreylowman
Copy link
Owner Author

Yeah good idea, very straightforward!

coreylowman added a commit that referenced this issue Jul 10, 2023
* add infrastructure for hyperparameter support for TensorCollections; add Gradients::as_model

* run cargo fmt

* use 'scalar' instead of 'hyperparameter'; use NumCast instead of ToPrimitive

* run cargo fmt

* add scalars to TensorCollection impls for examples listed in #485

* run cargo fmt

* implement npz scalar serialization

* fix documentation; simplify tensor/numpy.rs

* add scalars to safetensor serialization

* small simplification

---------

Co-authored-by: Corey Lowman <clowman1993@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants