Allow passing undefined Tensor to Module::register_parameter (#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 https://github.com/pytorch/pytorch/pull/26082 and https://github.com/pytorch/pytorch/pull/27156.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27948
Differential Revision: D17931739
Pulled By: yf225
fbshipit-source-id: 21bdfc88e66e3dc39f3caf608a6a3de48c510fa9