Fix expired deprecation of comparison dtype for NumPy 1.24+ (#91517)
> The `dtype=` argument to comparison ufuncs is now applied correctly. That
> means that only `bool` and `object` are valid values and `dtype=object` is
> enforced.
Source: https://numpy.org/doc/stable/release/1.24.0-notes.html#expired-deprecations
Fixes #91516
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91517
Approved by: https://github.com/zou3519, https://github.com/huydhn