Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/cunn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Paszke <adam.paszke@gmail.com>2017-03-22 18:29:39 +0300
committerAdam Paszke <adam.paszke@gmail.com>2017-03-22 18:29:39 +0300
commit724f18b653620836c71209b58c4d019a37e0806b (patch)
treeb0c636b6d35fe37df44dcfde99efe41bbc8c4270
parentb610a353c19baba213c2fdd6f0cc3a9dcc87a466 (diff)
Cast accumulator in LookupTable renorm to accreal
-rw-r--r--lib/THCUNN/generic/LookupTable.cu2
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))
{