fractional_max_pool{2/3}d : Fix segfaults for incorrect kernel_size and output_size (#51626)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/50967
TODO:
* [x] Add test for `fractional_max_pool3d` similar to `fractional_max_pool2d` (since there is no test for the same).
Needs Resolution:
* [ ] ASAN failure on the newly added 3d variant test. https://app.circleci.com/pipelines/github/pytorch/pytorch/269483/workflows/8426b3b7-9a35-4032-a57a-729964a4a5ff/jobs/10673756
* [ ] Failing gradcheck on MacOS. https://app.circleci.com/pipelines/github/pytorch/pytorch/269483/workflows/8426b3b7-9a35-4032-a57a-729964a4a5ff/jobs/10673101
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51626
Reviewed By: jbschlosser
Differential Revision: D26514064
Pulled By: heitorschueroff
fbshipit-source-id: e2cc57585dbc3a08c7f24591b202e0fabfd2a459