Committed by
GitHub
Fix compile errors for Linux (#2378)
This PR fixes a Linux build error by removing the non-portable std::logf call and using the C logf function instead. - Replace std::logf with logf in TenVadModel::Impl::LogMel to compile on Linux.
正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -321,7 +321,7 @@ class TenVadModel::Impl { | @@ -321,7 +321,7 @@ class TenVadModel::Impl { | ||
| 321 | static void LogMel(const float *in, int32_t n, float *out) { | 321 | static void LogMel(const float *in, int32_t n, float *out) { |
| 322 | for (int32_t i = 0; i != n; ++i) { | 322 | for (int32_t i = 0; i != n; ++i) { |
| 323 | // 20.79441541679836 is log(32768*32768) | 323 | // 20.79441541679836 is log(32768*32768) |
| 324 | - out[i] = std::logf(in[i] + 1e-10) - 20.79441541679836f; | 324 | + out[i] = logf(in[i] + 1e-10) - 20.79441541679836f; |
| 325 | } | 325 | } |
| 326 | } | 326 | } |
| 327 | 327 |
-
请 注册 或 登录 后发表评论