mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-12 17:57:38 +00:00
parent
8d782582f4
commit
21dde6fd16
1 changed files with 6 additions and 5 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue