diff options
author | A. Unique TensorFlower <nobody@tensorflow.org> | 2016-03-29 07:20:53 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-03-29 08:33:42 -0700 |
commit | fe60adfb9d46f662f6ee216db23409efdbbb20e2 (patch) | |
tree | 1cef61a185b3dc0f2250f0e586a5cc2a4eee6cb4 /tensorflow/core/kernels/segment_reduction_ops.cc | |
parent | 7b8cd1642b7d4bb08021480c8e130ba76d857452 (diff) |
Add explicit casts for a few ops that assumed it could implicitly cast to/from
float and int for all types T. (The assumption doesn't hold for Eigen::half.)
These were all ops I could find in CPU implementation; probably, some remain
for GPU (and some other problems remain before we can turn on Eigen::half for
all of them).
Change: 118464463
Diffstat (limited to 'tensorflow/core/kernels/segment_reduction_ops.cc')
-rw-r--r-- | tensorflow/core/kernels/segment_reduction_ops.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/core/kernels/segment_reduction_ops.cc b/tensorflow/core/kernels/segment_reduction_ops.cc index d7995ac3cc..5d4a19da3f 100644 --- a/tensorflow/core/kernels/segment_reduction_ops.cc +++ b/tensorflow/core/kernels/segment_reduction_ops.cc @@ -394,12 +394,12 @@ class SparseSegmentReductionOpBase : public OpKernel { out = L(0); } else { int r = num % 8; - T m = 1; + T m(1); if (is_mean_ && (num < 10)) { - m = num; + m = T(num); } if (is_sqrtn_ && (num < 10)) { - m = sqrt(num); + m = T(sqrt(num)); } switch (r) { case 2: { |