detect_anomaly() for SparseTensors (#29803)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/28649
1. Modified detect_anomaly() to use isnan()
2. isnan() for SparseTensors returns a bool Tensor of _values.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/29803
Differential Revision: D18594299
Pulled By: ezyang
fbshipit-source-id: 3f4190c569f53219be330584fc604ca43c4a6c7a