Update test cases generated by make_test() method to support running them in script mode. (#52748) (#53308)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53308
* Update tests for test_gru_* at this moment.
* Update flake8 error.
* Update tests for test_gru_* at this moment.
* Update flake8 error.
* Update test_gru_* test cases only.
* Fix flake8 issue.
* Fix flake8 issue on test.
* Still disable test cases created by make_test.
* Update code to fix issue 'AttributeError: 'RecursiveScriptModule' object has no attribute 'forward'' for test_elman_* test cases.
* Add script model support for test_lstm_* test cases.
Test Plan: Imported from OSS
Reviewed By: pbelevich, malfet
Differential Revision: D26922419
Pulled By: SplitInfinity
fbshipit-source-id: a96432b2e7da9b142a38f87fbaf56737117462c1