From 62abba193c74d6644e47428ab8c13ad6b07d6b21 Mon Sep 17 00:00:00 2001 From: hjchen2 Date: Tue, 15 Jan 2019 10:25:14 +0800 Subject: [PATCH] Replace std::expf with expf since expf is not a std function for ubuntu os --- test/operators/test_sequence_softmax_op.cpp | 2 +- test/operators/test_softmax_op.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/operators/test_sequence_softmax_op.cpp b/test/operators/test_sequence_softmax_op.cpp index 9e698d933a..17ab5d7a65 100644 --- a/test/operators/test_sequence_softmax_op.cpp +++ b/test/operators/test_sequence_softmax_op.cpp @@ -34,7 +34,7 @@ void SequenceSoftmax(const framework::LoDTensor *X, framework::LoDTensor *Y) { } float sum = 0.f; for (int j = 0; j < num_classes; ++j) { - float tmp = std::expf(input[j] - max); + float tmp = expf(input[j] - max); sum += tmp; output[j] = tmp; } diff --git a/test/operators/test_softmax_op.cpp b/test/operators/test_softmax_op.cpp index e94933eaa9..1cf39e3eff 100644 --- a/test/operators/test_softmax_op.cpp +++ b/test/operators/test_softmax_op.cpp @@ -38,7 +38,7 @@ void Softmax(const framework::Tensor *X, framework::Tensor *Y) { } float sum = 0.f; for (int j = 0; j < num_classes; ++j) { - float tmp = std::expf(input[j] - max); + float tmp = expf(input[j] - max); sum += tmp; output[j] = tmp; } -- GitLab