Fix deprecated warnings for nan_to_num (#46309)
Summary:
Related to https://github.com/pytorch/pytorch/issues/44592
This PR is to fix the deprecated warnings for the nan_to_num function.
Below is the warning message when building the latest code.
```
../aten/src/ATen/native/UnaryOps.cpp: In function ‘at::Tensor& at::native::nan_to_num_out(at::Tensor&,
const at::Tensor&, c10::optional<double>, c10::optional<double>, c10::optional<double>)’:
../aten/src/ATen/native/UnaryOps.cpp:397:45: warning: ‘bool c10::isIntegralType(c10::ScalarType)’
is deprecated: isIntegralType is deprecated.
Please use the overload with 'includeBool' parameter instead. [-Wdeprecated-declarations]
if (c10::isIntegralType(self.scalar_type())) {
```
The deprecated warning is defined in `ScalarType.h`.
https://github.com/pytorch/pytorch/blob/d790ec6de01a61fe81733c41a64b6092bacfb7bd/c10/core/ScalarType.h#L255-L260
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46309
Reviewed By: mrshenli
Differential Revision: D24310248
Pulled By: heitorschueroff
fbshipit-source-id: 0f9f2ad304eb5a2da9d2b415343f2fc9029037af