Browse Source

SyntaxNet does not compile, because isnan is unknown. (#1229)

SyntaxNet does not compile with gcc version 5.4.0 20160609 (Ubuntu
5.4.0-6ubuntu1~16.04.4). This leads to the error in #1194.

Including cmath and using the std namespace for isnan solves this
problem.
Daniël de Kok 8 years ago
parent
commit
26bf7ce968
1 changed files with 2 additions and 1 deletions
  1. 2 1
      syntaxnet/dragnn/core/beam.h

+ 2 - 1
syntaxnet/dragnn/core/beam.h

@@ -2,6 +2,7 @@
 #define NLP_SAFT_OPENSOURCE_DRAGNN_CORE_BEAM_H_
 
 #include <algorithm>
+#include <cmath>
 #include <memory>
 #include <vector>
 
@@ -112,7 +113,7 @@ class Beam {
             CHECK_LT(matrix_idx, matrix_length)
                 << "Matrix index out of bounds!";
             const double score_delta = transition_matrix[matrix_idx];
-            CHECK(!isnan(score_delta));
+            CHECK(!std::isnan(score_delta));
             candidate.source_idx = beam_idx;
             candidate.action = action_idx;
             candidate.resulting_score = state->GetScore() + score_delta;