diff options
author | Adam Paszke <adam.paszke@gmail.com> | 2017-03-22 18:29:39 +0300 |
---|---|---|
committer | Adam Paszke <adam.paszke@gmail.com> | 2017-03-22 18:29:39 +0300 |
commit | 724f18b653620836c71209b58c4d019a37e0806b (patch) | |
tree | b0c636b6d35fe37df44dcfde99efe41bbc8c4270 | |
parent | b610a353c19baba213c2fdd6f0cc3a9dcc87a466 (diff) |
Cast accumulator in LookupTable renorm to accreal
-rw-r--r-- | lib/THCUNN/generic/LookupTable.cu | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/THCUNN/generic/LookupTable.cu b/lib/THCUNN/generic/LookupTable.cu index 955b29b..bb30e0a 100644 --- a/lib/THCUNN/generic/LookupTable.cu +++ b/lib/THCUNN/generic/LookupTable.cu @@ -185,7 +185,7 @@ void THNN_(LookupTable_renorm)( THCIndex_t k = idx_ptr[i] - TH_INDEX_BASE; thrust::device_ptr<real> row_ptr = weight_ptr + k * stride; accreal norm = thrust::transform_reduce(row_ptr, row_ptr + stride, - unary_pow, 0, binary_plus); + unary_pow, (accreal)0, binary_plus); norm = std::pow(norm, (accreal) (1.0 / normType)); if (norm > ScalarConvert<real, accreal>::to(maxNorm)) { |