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
5d3456e4
Unverified
Commit
5d3456e4
authored
Jul 29, 2019
by
Robert Kimball
Committed by
GitHub
Jul 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3324 from NervanaSystems/bob/unit-test
Changes to get allow NNP to pass tests
parents
f4d44bbc
9733630b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
batch_mat_mul.in.cpp
test/backend/batch_mat_mul.in.cpp
+2
-1
computation_reuse.in.cpp
test/backend/computation_reuse.in.cpp
+11
-8
No files found.
test/backend/batch_mat_mul.in.cpp
View file @
5d3456e4
...
...
@@ -89,7 +89,8 @@ NGRAPH_TEST(${BACKEND_NAME}, batch_mat_mul_forward)
auto
backend_results
=
execute
(
backend_f
,
batchmatmul_args
,
"${BACKEND_NAME}"
);
for
(
size_t
i
=
0
;
i
<
ref_results
.
size
();
i
++
)
{
EXPECT_TRUE
(
test
::
all_close
(
ref_results
.
at
(
i
),
backend_results
.
at
(
i
),
1.0e-4
f
,
1.0e-4
f
));
EXPECT_TRUE
(
test
::
all_close_f
(
ref_results
.
at
(
i
),
backend_results
.
at
(
i
),
DEFAULT_FLOAT_TOLERANCE_BITS
+
3
));
}
}
#endif
test/backend/computation_reuse.in.cpp
View file @
5d3456e4
...
...
@@ -55,16 +55,19 @@ NGRAPH_TEST(${BACKEND_NAME}, computation_reuse)
vector
<
float
>
weights
(
512
,
0.5
f
);
vector
<
float
>
rv
(
128
);
auto
a
=
backend
->
create_tensor
(
element
::
f32
,
shape_a
,
input
.
data
()
);
auto
b
=
backend
->
create_tensor
(
element
::
f32
,
shape_b
,
weights
.
data
()
);
auto
result
=
backend
->
create_tensor
(
element
::
f32
,
shape_r
,
rv
.
data
()
);
auto
a
=
backend
->
create_tensor
(
element
::
f32
,
shape_a
);
auto
b
=
backend
->
create_tensor
(
element
::
f32
,
shape_b
);
auto
result
=
backend
->
create_tensor
(
element
::
f32
,
shape_r
);
auto
handle
=
backend
->
compile
(
f
);
handle
->
call_with_validate
({
result
},
{
a
,
b
}
);
copy_data
(
a
,
input
);
copy_data
(
b
,
weights
);
vector
<
float
>
rv_saved
(
rv
);
auto
exec
=
backend
->
compile
(
f
);
exec
->
call_with_validate
({
result
},
{
a
,
b
});
vector
<
float
>
rv_saved
(
read_vector
<
float
>
(
result
));
b
->
set_stale
(
false
);
handle
->
call_with_validate
({
result
},
{
a
,
b
});
EXPECT_TRUE
(
test
::
all_close_f
(
rv_saved
,
r
v
));
exec
->
call_with_validate
({
result
},
{
a
,
b
});
EXPECT_TRUE
(
test
::
all_close_f
(
rv_saved
,
r
ead_vector
<
float
>
(
result
)
));
}
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