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

named_parameters error when multiple references #988

Open
dfalbel opened this issue Mar 3, 2023 · 0 comments
Open

named_parameters error when multiple references #988

dfalbel opened this issue Mar 3, 2023 · 0 comments

Comments

@dfalbel
Copy link
Member

dfalbel commented Mar 3, 2023

# This returns only weight1
net$named_parameters(TRUE)
#> $weight1
#> torch_tensor
#> -2.2368
#> [ CPUFloatType{1,1} ][ requires_grad = TRUE ]
# This returns weight1 and weight2
net$named_parameters(FALSE)

This is a bug. We should only ever return unique tensors.
We could potentially make it an error to assign the same tensor to multiple names within a module to avoid having to handle this case.

Originally posted by @dfalbel in #968 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant