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
2ca1528e
Commit
2ca1528e
authored
Feb 12, 2018
by
Jaikrishnan Menon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge fixes
parent
1fbc72d6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
cpu_fusion.cpp
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
+1
-1
cpu_fusion.hpp
src/ngraph/runtime/cpu/pass/cpu_fusion.hpp
+9
-3
cpu_fusion.cpp
test/cpu_fusion.cpp
+2
-2
No files found.
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
View file @
2ca1528e
...
...
@@ -97,7 +97,7 @@ static std::vector<T> apply_permutation(std::vector<T> input, ngraph::AxisVector
return
output
;
}
void
ngraph
::
pass
::
CPUFusion
::
construct_gemm_pattern
()
void
ngraph
::
runtime
::
cpu
::
pass
::
CPUFusion
::
construct_gemm_pattern
()
{
auto
shape_w
=
Shape
{
2
,
4
};
auto
shape_x
=
Shape
{
4
,
1
};
...
...
src/ngraph/runtime/cpu/pass/cpu_fusion.hpp
View file @
2ca1528e
...
...
@@ -20,13 +20,19 @@
namespace
ngraph
{
namespace
pass
namespace
runtime
{
class
CPUFusion
;
namespace
cpu
{
namespace
pass
{
class
CPUFusion
;
}
}
}
}
class
ngraph
::
pass
::
CPUFusion
:
public
ngraph
::
pass
::
GraphRewrite
class
ngraph
::
runtime
::
cpu
::
pass
::
CPUFusion
:
public
ngraph
::
pass
::
GraphRewrite
{
public
:
CPUFusion
()
...
...
test/cpu_fusion.cpp
View file @
2ca1528e
...
...
@@ -144,7 +144,7 @@ TEST(cpu_fusion, cpu_fusion_pass_basic)
auto
add
=
dot
+
broadcast
;
auto
graph
=
make_shared
<
op
::
Abs
>
(
add
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
CPUFusion
>
();
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUFusion
>
();
auto
func
=
make_shared
<
Function
>
(
graph
,
op
::
Parameters
{
A
,
B
,
C
});
pass_manager
.
run_passes
(
func
);
ASSERT_NE
(
std
::
dynamic_pointer_cast
<
op
::
MatmulBias
>
(
graph
->
get_input_op
(
0
)),
nullptr
);
...
...
@@ -157,7 +157,7 @@ TEST(cpu_fusion, gemm_mlp)
stringstream
ss
(
json_string
);
shared_ptr
<
Function
>
func
=
ngraph
::
deserialize
(
ss
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
CPUFusion
>
();
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUFusion
>
();
pass_manager
.
run_passes
(
func
);
size_t
ccg
=
count_ops_of_type
<
op
::
MatmulBias
>
(
func
);
ASSERT_EQ
(
ccg
,
3
);
...
...
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