-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Allow passing undefined Tensor to Module::register_parameter #27948
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
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yf225 is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
why do it this way instead of |
|
@gchanan I feel that I need to make this consistent with how we represent a nullable Tensor within a C++ module, and I think there are two issues with using
|
|
…#27948) Summary: C++ API `Module::register_parameter` should accept undefined Tensor as parameter, which is equivalent to `module.register_parameter("param", None)` in Python API. This unblocks pytorch#26082 and pytorch#27156. Pull Request resolved: pytorch#27948 Differential Revision: D17931739 Pulled By: yf225 fbshipit-source-id: 21bdfc88e66e3dc39f3caf608a6a3de48c510fa9
C++ API
Module::register_parametershould accept undefined Tensor as parameter, which is equivalent tomodule.register_parameter("param", None)in Python API.This unblocks #26082 and #27156.