Update `generate_opcheck_tests`, also use it to test some internal tests (#107328)
Summary:
We change `generate_opcheck_tests` to be a bit more user-friendly. Note that
there are some internal-only changes, go review them there.
Test Plan: - tests
Differential Revision: D47965247
Pull Request resolved: https://github.com/pytorch/pytorch/pull/107328
Approved by: https://github.com/ezyang