Use `constructor` in test_params for C++ API parity test (#25749)
Summary:
This PR changes the C++ API parity test script so that `test_params` such as the following is understood:
https://github.com/pytorch/pytorch/blob/88e4cee3e70aac95dd2c18b898808ce3426cb3c9/test/common_nn.py#L2194-L2200
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25749
Differential Revision: D17227867
Pulled By: yf225
fbshipit-source-id: 03a8e17d233931ba0b38f75e9b75b0c09b98ed08