[ONNX] Improve error handling for adaptive_pool (#45874)
Summary:
Duplicate of https://github.com/pytorch/pytorch/issues/43032
This update would also improve error handling for interpolate with 'area' mode.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45874
Reviewed By: albanD
Differential Revision: D24141266
Pulled By: bzinodev
fbshipit-source-id: 7559f1d6af4f1ef3507c15a1aee76fe01fa433cd