forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix dtype mismatches in rejection_resample.
Cast `initial_dist` and `target_dist` to `float32`. Normally TensorFlow doesn't cast things for you, but I think in this case it's reasonable because: - The cast is once per dataset, not in the inner loop. - A float32 can handle numbers as small as `1e-38`. If your sample probability is near that small it's already effectively zero. PiperOrigin-RevId: 373045036 Change-Id: I19de99280d44d02010c34514ea53a7ef4e2fedc5
- Loading branch information
1 parent
a73de08
commit 130e833
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters