[NVIDIA TF] Optimize mixed-precision finite check for sparse tensors.
@fchollet what's the status of the code in `tensorflow/python/keras`? Should we still update it and accept PRs to it? Note there is a corresponding Keras PR https://github.com/keras-team/keras/pull/17638. This is failing tests: https://source.cloud.google.com/results/invocations/2c6a3700-5008-4e42-882c-81fe07b7b9cd/targets/pkg%2Fpip_and_nonpip_tests/tests Sorry about that. Tests fixed. @Reedwm PTAL.
Mixed precision can be very slow and memory inefficient with sparse tensors, common, for example, in recommender-type models.

The largest inefficiencies come from checking sparse tensors for NaN values when dynamic loss scaling is enabled.

This PR implements a simple optimization to use the dense values of IndexedSlices directly during NaN checks.

c.f., Keras PR https://github.com/keras-team/keras/pull/17638
Atten: @reedwm 