Fix compiler warnings pertaining to uniform_int() (#49914)
Summary:
**PROBLEM DESCRIPTION:**
GitHub issue 46391 suggests that compiler warnings pertaining to _floating-point value does not fit in required integral type_ might cause some confusion.
These compiler-warnings arise during compilation of the templated function `uniform_int()`. The warnings are misleading because they arise from the way the compiler compiles templated functions, but the if-else statements in the function obviate the possibilities that the warnings describe. So, the purpose of a fix would only be to fix the compiler warnings, and not to fix any sort of a bug.
**FIX DESCRIPTION:**
[EDITED, after inputs from malfet]: In the function `uniform_int()`, the if-else conditions pertaining to types `double` & `float` can be removed, and then an overloaded specialized function can be added for floating-point types. The current version of the function can be specialized to not have its return type as a floating point type.
An unrelated observation is that the if-else condition pertaining to the type `double` (line 57 in the original code) was redundant, as line 61 in the original code covered it (`std::is_floating_point<T>::value` would also have been true for the type `double`).
Fixes https://github.com/pytorch/pytorch/issues/46391
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49914
Reviewed By: H-Huang
Differential Revision: D25808037
Pulled By: malfet
fbshipit-source-id: 3f94c4bca877f09720b0d6efa5e1788554aba074