Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
0d7cc027
Commit
0d7cc027
authored
Jun 21, 2019
by
Rob Earhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust PlaidML test tolerances
parent
ba226a14
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
+34
-2
CMakeLists.txt
test/CMakeLists.txt
+2
-0
backend_binary_elementwise.in.cpp
test/backend_binary_elementwise.in.cpp
+10
-0
backend_test.in.cpp
test/backend_test.in.cpp
+12
-2
backend_unary_elementwise.in.cpp
test/backend_unary_elementwise.in.cpp
+10
-0
No files found.
test/CMakeLists.txt
View file @
0d7cc027
...
@@ -255,6 +255,8 @@ endif()
...
@@ -255,6 +255,8 @@ endif()
if
(
NGRAPH_PLAIDML_ENABLE
)
if
(
NGRAPH_PLAIDML_ENABLE
)
target_link_libraries
(
unit-test PRIVATE plaidml_backend
)
target_link_libraries
(
unit-test PRIVATE plaidml_backend
)
# Some PlaidML devices aren't so precise, so we increase the allowable tolerance.
target_compile_definitions
(
unit-test PRIVATE
"PlaidML_FLOAT_TOLERANCE_BITS=12"
)
endif
()
endif
()
if
(
NGRAPH_TBB_ENABLE
)
if
(
NGRAPH_TBB_ENABLE
)
...
...
test/backend_binary_elementwise.in.cpp
View file @
0d7cc027
...
@@ -21,6 +21,16 @@
...
@@ -21,6 +21,16 @@
#include <random>
#include <random>
#include <string>
#include <string>
// clang-format off
#ifdef ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#define DEFAULT_FLOAT_TOLERANCE_BITS ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#endif
#ifdef ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#define DEFAULT_DOUBLE_TOLERANCE_BITS ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#endif
// clang-format on
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "ngraph/ngraph.hpp"
#include "util/all_close.hpp"
#include "util/all_close.hpp"
...
...
test/backend_test.in.cpp
View file @
0d7cc027
...
@@ -22,6 +22,16 @@
...
@@ -22,6 +22,16 @@
#include <string>
#include <string>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
// clang-format off
#ifdef ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#define DEFAULT_FLOAT_TOLERANCE_BITS ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#endif
#ifdef ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#define DEFAULT_DOUBLE_TOLERANCE_BITS ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#endif
// clang-format on
#include "ngraph/autodiff/adjoints.hpp"
#include "ngraph/autodiff/adjoints.hpp"
#include "ngraph/graph_util.hpp"
#include "ngraph/graph_util.hpp"
#include "ngraph/log.hpp"
#include "ngraph/log.hpp"
...
@@ -5234,7 +5244,7 @@ NGRAPH_TEST(${BACKEND_NAME}, sigmoid_bprop_n1c1h4)
...
@@ -5234,7 +5244,7 @@ NGRAPH_TEST(${BACKEND_NAME}, sigmoid_bprop_n1c1h4)
handle
->
call_with_validate
({
result
},
{
a
,
b
});
handle
->
call_with_validate
({
result
},
{
a
,
b
});
vector
<
float
>
expected
{
0.196612
f
,
0.0176627
f
,
0.196612
f
,
0.0176627
f
};
vector
<
float
>
expected
{
0.196612
f
,
0.0176627
f
,
0.196612
f
,
0.0176627
f
};
EXPECT_TRUE
(
test
::
all_close
(
expected
,
read_vector
<
float
>
(
result
)));
EXPECT_TRUE
(
test
::
all_close
_f
(
expected
,
read_vector
<
float
>
(
result
)));
}
}
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
relu_2Dfprop
)
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
relu_2Dfprop
)
...
@@ -5540,7 +5550,7 @@ NGRAPH_TEST(${BACKEND_NAME}, softmax_underflow)
...
@@ -5540,7 +5550,7 @@ NGRAPH_TEST(${BACKEND_NAME}, softmax_underflow)
handle
->
call_with_validate
({
result
},
{
a
});
handle
->
call_with_validate
({
result
},
{
a
});
vector
<
float
>
expected
{
vector
<
float
>
expected
{
expf
(
low
)
/
d0
,
expf
(
1
)
/
d1
,
expf
(
2
)
/
d2
,
expf
(
3
)
/
d0
,
expf
(
4
)
/
d1
,
expf
(
5
)
/
d2
};
expf
(
low
)
/
d0
,
expf
(
1
)
/
d1
,
expf
(
2
)
/
d2
,
expf
(
3
)
/
d0
,
expf
(
4
)
/
d1
,
expf
(
5
)
/
d2
};
EXPECT_TRUE
(
test
::
all_close
(
expected
,
read_vector
<
float
>
(
result
)));
EXPECT_TRUE
(
test
::
all_close
_f
(
expected
,
read_vector
<
float
>
(
result
)));
}
}
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
softmax_overflow
)
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
softmax_overflow
)
...
...
test/backend_unary_elementwise.in.cpp
View file @
0d7cc027
...
@@ -21,6 +21,16 @@
...
@@ -21,6 +21,16 @@
#include <random>
#include <random>
#include <string>
#include <string>
// clang-format off
#ifdef ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#define DEFAULT_FLOAT_TOLERANCE_BITS ${BACKEND_NAME}_FLOAT_TOLERANCE_BITS
#endif
#ifdef ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#define DEFAULT_DOUBLE_TOLERANCE_BITS ${BACKEND_NAME}_DOUBLE_TOLERANCE_BITS
#endif
// clang-format on
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
#include "ngraph/ngraph.hpp"
#include "util/all_close.hpp"
#include "util/all_close.hpp"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment