Clang build failure in test (#683)

* fixing clang build failure
This commit is contained in:
utsabsingharoy 2019-03-23 01:47:56 +05:30 committed by Changming Sun
parent 8d782582f4
commit 21dde6fd16

View file

@ -4,6 +4,7 @@
#include "gtest/gtest.h"
#include "test/providers/provider_test_utils.h"
#include "core/util/math.h"
#include <cmath>
namespace onnxruntime {
namespace test {
@ -374,7 +375,7 @@ TEST(MathOpTest, Pow) {
std::vector<int64_t> dims{2, 2};
test.AddInput<float>("X", dims,
{2.0f, 2.0f,
sqrt(2.0f), 1.0f});
std::sqrt(2.0f), 1.0f});
test.AddInput<float>("Y", dims,
{0.0f, 8.0f,
2.0f, 9.0f});
@ -411,8 +412,8 @@ TEST(MathOpTest, Exp) {
{0.0f, 1.0f,
2.0f, 10.0f});
test.AddOutput<float>("Y", dims,
{1.0f, exp(1.0f),
exp(2.0f), exp(10.0f)});
{1.0f, std::exp(1.0f),
std::exp(2.0f), std::exp(10.0f)});
test.SetOutputRelErr("Y", 1e-7f);
test.Run();
}
@ -424,8 +425,8 @@ TEST(MathOpTest, Log) {
{1.0f, 2.0f,
5.0f, 10.0f});
test.AddOutput<float>("Y", dims,
{0.0f, log(2.0f),
log(5.0f), log(10.0f)});
{0.0f, std::log(2.0f),
std::log(5.0f), std::log(10.0f)});
test.Run();
}