Impl for ParameterList (#41259)
Summary:
This is a new PR for https://github.com/pytorch/pytorch/issues/40850, https://github.com/pytorch/pytorch/issues/40987 and https://github.com/pytorch/pytorch/issues/41206(I unintentionally closed), as I have some issues for rebates for that one. Very sorry about that. And I have fixed the tests failed in that PR.
This diff contains the implementation of C++ API for ParameterList from https://github.com/pytorch/pytorch/issues/25883.
Refer to the Python API: https://github.com/pytorch/pytorch/blob/bc9e8af21875dafafe9bbd25c8f542b20b2e660f/torch/nn/modules/container.py#L376
Not sure about some naming difference between C++ API and Python API, like `append`, should it be called `push_back`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41259
Test Plan: Add unit tests in this diff
Differential Revision: D22495780
Pulled By: glaringlee
fbshipit-source-id: 79ea3592db640f35477d445ecdaeafbdad814bec