Align max_pool1d Error Checking between CPU and CUDA/CPU requires_grad (#90211)
Fixes https://github.com/pytorch/pytorch/issues/85712
Standardizes error checking for max_pool1d between CPU and CPU requires_grad/CUDA.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/90211
Approved by: https://github.com/mruberry