fix max_pool2d cuda version Dimension out of range issue(#36046) (#36095)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36095
Test Plan: Imported from OSS
Differential Revision: D20876733
Pulled By: glaringlee
fbshipit-source-id: a2b92fd2dd0254c5443af469e3fb2faa2323e5c9