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

Setting Linear.weight is not reflected in 'parameters()' #499

Closed
NiklasGustafsson opened this issue Jan 26, 2022 · 1 comment · Fixed by #501
Closed

Setting Linear.weight is not reflected in 'parameters()' #499

NiklasGustafsson opened this issue Jan 26, 2022 · 1 comment · Fixed by #501
Assignees
Labels
bug Something isn't working

Comments

@NiklasGustafsson
Copy link
Contributor

NiklasGustafsson commented Jan 26, 2022

When the 'weight' property of a linear layer (and probably others, too) is set, the new tensor is not reflected in the parameters list.

@NiklasGustafsson NiklasGustafsson self-assigned this Jan 26, 2022
@NiklasGustafsson NiklasGustafsson added the bug Something isn't working label Jan 26, 2022
@NiklasGustafsson
Copy link
Contributor Author

Debugging it, it seems like setting the 'weight' field in the native code implementation of Linear does not alter what its 'parameters()' function returns.

This suggests that we will have to re-implement the Module.parameters() function in C# to not rely on native code, instead assembling the parameters from each module in .NET code. I need to think a bit about that.

NiklasGustafsson added a commit to NiklasGustafsson/TorchSharp that referenced this issue Jan 28, 2022
NiklasGustafsson added a commit to NiklasGustafsson/TorchSharp that referenced this issue Jan 28, 2022
@NiklasGustafsson NiklasGustafsson linked a pull request Jan 31, 2022 that will close this issue
NiklasGustafsson added a commit that referenced this issue Feb 3, 2022
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
Development

Successfully merging a pull request may close this issue.

1 participant