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
38b28c13
Commit
38b28c13
authored
Feb 22, 2018
by
nikolay.korovaiko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conv+bias tests
parent
22819e78
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
cpu_fusion.cpp
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
+1
-1
cpu_fusion.cpp
test/cpu_fusion.cpp
+15
-0
conv_bias.json
test/models/conv_bias.json
+0
-0
No files found.
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
100644 → 100755
View file @
38b28c13
...
...
@@ -298,7 +298,7 @@ void ngraph::runtime::cpu::pass::CPUFusion::construct_conv_bias()
std
::
shared_ptr
<
Node
>
nn
;
auto
conv
=
std
::
dynamic_pointer_cast
<
op
::
Convolution
>
(
m
.
match_root
()
->
get_input_op
(
0
));
auto
bias
=
m
.
match_root
()
->
get_input_op
(
1
);
auto
bias
=
m
.
match_root
()
->
get_input_op
(
1
)
->
get_input_op
(
0
)
;
auto
conv_bias
=
std
::
shared_ptr
<
Node
>
(
new
op
::
ConvolutionBias
(
conv
,
bias
));
return
conv_bias
;
};
...
...
test/cpu_fusion.cpp
View file @
38b28c13
...
...
@@ -36,6 +36,7 @@
#include "ngraph/json.hpp"
#include "ngraph/pass/reshape_elimination.hpp"
#include "ngraph/pass/visualize_tree.hpp"
#include "ngraph/runtime/cpu/ops/conv_bias.hpp"
#include "ngraph/runtime/cpu/ops/matmul_bias.hpp"
#include "ngraph/runtime/cpu/pass/cpu_fusion.hpp"
#include "ngraph/serializer.hpp"
...
...
@@ -288,3 +289,17 @@ TEST(cpu_fusion, fuse_fprop_bn)
size_t
ccg
=
count_ops_of_type
<
op
::
BatchNorm
>
(
func
);
ASSERT_EQ
(
ccg
,
1
);
}
TEST
(
cpu_fusion
,
fuse_conv_bias
)
{
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
ngraph
::
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUFusion
>
();
const
string
json_path
=
file_util
::
path_join
(
SERIALIZED_ZOO
,
"conv_bias.json"
);
const
string
json_string
=
file_util
::
read_file_to_string
(
json_path
);
stringstream
ss
(
json_string
);
shared_ptr
<
Function
>
func
=
ngraph
::
deserialize
(
ss
);
pass_manager
.
run_passes
(
func
);
size_t
cb
=
count_ops_of_type
<
op
::
ConvolutionBias
>
(
func
);
ASSERT_GT
(
cb
,
0
);
}
test/models/conv_bias.json
0 → 100755
View file @
38b28c13
This diff is collapsed.
Click to expand it.
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