r2.11 cherry-pick: ee50d1e00f8 "Fix security vulnerability with FractionalMax(AVG)Pool with illegal pooling_ratio"
Refer to the original commit: https://github.com/tensorflow/tensorflow/commit/ee50d1e00f81f62a4517453f721c634bbb478307