diff options
author | 2017-05-23 18:23:28 -0700 | |
---|---|---|
committer | 2017-05-23 18:29:59 -0700 | |
commit | 40f8fd053c06d51d521b90112ea6ffaad03e2fc9 (patch) | |
tree | 26edd345fbe4c0620e9f7220d4983e58ec273e27 /tensorflow/core/kernels/multinomial_op_gpu.cu.cc | |
parent | 1c5715078cf726411fc3f5667c503ab33c9f1612 (diff) |
Automated g4 rollback of changelist 156917266
PiperOrigin-RevId: 156939644
Diffstat (limited to 'tensorflow/core/kernels/multinomial_op_gpu.cu.cc')
-rw-r--r-- | tensorflow/core/kernels/multinomial_op_gpu.cu.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tensorflow/core/kernels/multinomial_op_gpu.cu.cc b/tensorflow/core/kernels/multinomial_op_gpu.cu.cc index 19b4f3ca55..97c00ad9c7 100644 --- a/tensorflow/core/kernels/multinomial_op_gpu.cu.cc +++ b/tensorflow/core/kernels/multinomial_op_gpu.cu.cc @@ -87,13 +87,9 @@ struct MultinomialFunctor<GPUDevice, T> { // Calculates "scores = logits - log(-log(noises))"; B*C*S elements. // NOTE: we don't store back to "noises" because having it appear on both // sides is potentially unsafe (e.g. Eigen may use ldg() to load RHS data). - // 2e-30 is chosen so as to be small enough to only change 0 -> 2e-30 while - // not affect any of the other numbers (smallest is ~1e-7), but not so small - // that log(x) == -inf, which is why it needs to be larger than 0 in the - // first place. To32Bit(scores).device(d) = To32Bit(logits).reshape(boc).broadcast(oso).template cast<float>() - - ((-((To32Bit(noises) + 2e-30f).log())).log()); + ((-(To32Bit(noises).log())).log()); // Max-reduce along classes for each (batch, sample). To32Bit(maxima).device(d) = To32Bit(scores).reshape(bsc).maximum(kTwo); |