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:
authorSoumith Chintala <soumith@gmail.com>2017-03-22 18:53:41 +0300
committerGitHub <noreply@github.com>2017-03-22 18:53:41 +0300
commit6b6a462d9e0781957f66ab209f051201cdb190de (patch)
tree5637eab8ed481be90b44574329fbf6347fee1a67
parentab320e23301096bfd4863521d191b55b30deeef8 (diff)
parent724f18b653620836c71209b58c4d019a37e0806b (diff)
Merge pull request #453 from apaszke/lookup_renorm
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))
{