We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57e2a89 commit adc63adCopy full SHA for adc63ad
examples/perplexity/perplexity.cpp
@@ -9,7 +9,7 @@ std::vector<double> softmax(const std::vector<float>& logits) {
9
for (size_t i = 0; i < logits.size(); i++) {
10
// Subtract the maximum logit value from the current logit value for numerical stability
11
float logit = logits[i] - max_logit;
12
- double exp_logit = std::exp(logit);
+ double exp_logit = std::exp((double)logit);
13
sum_exp += exp_logit;
14
probs[i] = exp_logit;
15
}
0 commit comments