[ROCm] Fix for std::isnan regression in ROCm (#34664)
Summary:
Filing this PR since we are in the process of migrating ROCm CI to ROCm version 3.1. This patch is to ensure the correct functionality of float <-> bfloat16 conversion in rocm3.1. `std::isnan` regresses with rocm3.1.
iotamudelta ezyang
cc: ashishfarmer (original author of this patch)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/34664
Differential Revision: D20440972
Pulled By: ezyang
fbshipit-source-id: 1ccb911c88f05566d94e01878df6c70cf7f31242