[adaptive_]max_pool{1,2,3}d: handle edge case when input is filled with -inf (#40665)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/40131
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40665
Differential Revision: D22463538
Pulled By: ezyang
fbshipit-source-id: 7e08fd0205926911d45aa150012154637e64a8d4