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
2ffbfb1f
Unverified
Commit
2ffbfb1f
authored
Apr 09, 2019
by
Robert Kimball
Committed by
GitHub
Apr 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename files to .png since that is the format the files really y are (#2721)
parent
bf7c6f68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
60 deletions
+60
-60
algebraic_simplification.cpp
test/algebraic_simplification.cpp
+14
-14
concat_fusion.cpp
test/concat_fusion.cpp
+10
-10
cpu_fusion.cpp
test/cpu_fusion.cpp
+11
-11
reshape_elimination.cpp
test/reshape_elimination.cpp
+15
-15
reshape_sinking.cpp
test/reshape_sinking.cpp
+10
-10
No files found.
test/algebraic_simplification.cpp
View file @
2ffbfb1f
...
...
@@ -378,9 +378,9 @@ TEST(algebraic_simplification, concat_reshape_slice)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
reshape1
,
reshape2
,
reshape3
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
@@ -401,9 +401,9 @@ TEST(algebraic_simplification, concat_slice)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
slice1
,
slice2
,
slice3
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
@@ -421,9 +421,9 @@ TEST(algebraic_simplification, concat_parameter_slice)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
slice1
,
slice2
,
slice3
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
@@ -441,9 +441,9 @@ TEST(algebraic_simplification, concat_parameter_slices_reversed)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
slice3
,
slice2
,
slice1
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
@@ -462,9 +462,9 @@ TEST(algebraic_simplification, concat_parameter_slices_element_count)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
slice1
,
slice2
,
slice3
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
@@ -482,9 +482,9 @@ TEST(algebraic_simplification, concat_parameter_non_uniform_slices)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
slice1
,
slice2
,
slice3
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
@@ -507,9 +507,9 @@ TEST(algebraic_simplification, concat_different_goes)
auto
concat
=
make_shared
<
op
::
Concat
>
(
NodeVector
{
slice1
,
slice2
,
slice3
},
concat_axis
);
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
AlgebraicSimplification
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
auto
f
=
std
::
make_shared
<
Function
>
(
ngraph
::
NodeVector
{
concat
},
ParameterVector
{
a
});
pass_manager
.
run_passes
(
f
);
...
...
test/concat_fusion.cpp
View file @
2ffbfb1f
...
...
@@ -69,10 +69,10 @@ TEST(concat_fusion, single_branch)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_single_branch.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_single_branch.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ConcatElimination
>
();
pass_manager
.
register_pass
<
pass
::
SelfConcatFusion
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_single_branch.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_single_branch.p
ng
"
);
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -116,10 +116,10 @@ TEST(concat_fusion, multiple_branches_1)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_multiple_branches_1.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_multiple_branches_1.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ConcatElimination
>
();
pass_manager
.
register_pass
<
pass
::
SelfConcatFusion
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_multiple_branches_1.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_multiple_branches_1.p
ng
"
);
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -159,10 +159,10 @@ TEST(concat_fusion, multiple_branches_2)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_multiple_branches_2.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_multiple_branches_2.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ConcatElimination
>
();
pass_manager
.
register_pass
<
pass
::
SelfConcatFusion
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_multiple_branches_2.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_multiple_branches_2.p
ng
"
);
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -211,10 +211,10 @@ TEST(concat_fusion, non_fusable_self_concat)
auto
baseline_input_shape_2
=
baseline_f
->
get_parameters
().
at
(
1
)
->
get_shape
();
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_non_fusable_self_concat.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_non_fusable_self_concat.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ConcatElimination
>
();
pass_manager
.
register_pass
<
pass
::
SelfConcatFusion
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_non_fusable_self_concat.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_non_fusable_self_concat.p
ng
"
);
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -266,10 +266,10 @@ TEST(concat_fusion, self_concat_with_fan_out)
auto
baseline_input_shape_2
=
baseline_f
->
get_parameters
().
at
(
1
)
->
get_shape
();
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_self_concat_with_fan_out.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_self_concat_with_fan_out.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ConcatElimination
>
();
pass_manager
.
register_pass
<
pass
::
SelfConcatFusion
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_self_concat_with_fan_out.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_self_concat_with_fan_out.p
ng
"
);
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
test/cpu_fusion.cpp
View file @
2ffbfb1f
...
...
@@ -1423,22 +1423,22 @@ TEST(cpu_fusion, max_pool_with_indices)
{
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_fprop_before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_fprop_before.p
ng
"
);
pass_manager
.
run_passes
(
f
);
}
{
NodeVector
nv_cwi
;
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_before.p
ng
"
);
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUWorkspaceInsertion
>
(
nv_cwi
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_after.p
ng
"
);
pass_manager
.
run_passes
(
df
);
}
{
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_fprop_after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_fprop_after.p
ng
"
);
pass_manager
.
run_passes
(
f
);
}
...
...
@@ -1493,9 +1493,9 @@ TEST(cpu_fusion, backwards_maxpool_with_indices_n4_c1_hw4_2x2_max)
{
NodeVector
nv_cwi
;
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_before2.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_before2.p
ng
"
);
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUWorkspaceInsertion
>
(
nv_cwi
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_after2.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"max_pool_bprop_after2.p
ng
"
);
pass_manager
.
run_passes
(
df
);
}
...
...
@@ -1794,7 +1794,7 @@ void optimize_graph(std::shared_ptr<ngraph::Function>& f, std::shared_ptr<ngraph
pass_manager
.
register_pass
<
ngraph
::
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
ngraph
::
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUWorkspaceInsertion
>
(
nv_cwi
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.fprop_cache.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.fprop_cache.p
ng
"
);
pass_manager
.
run_passes
(
f
);
pass_manager
.
run_passes
(
bf
);
...
...
@@ -2140,9 +2140,9 @@ TEST(cpu_fusion, group_convolution_fusion)
auto
f
=
make_shared
<
Function
>
(
NodeVector
{
concat
},
ParameterVector
{
A
,
B
});
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_group.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before_group.p
ng
"
);
pass_manager
.
register_pass
<
runtime
::
cpu
::
pass
::
CPUBatchFusion
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_group.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after_group.p
ng
"
);
pass_manager
.
run_passes
(
f
);
auto
gc
=
std
::
dynamic_pointer_cast
<
op
::
GroupConvolution
>
(
f
->
get_results
().
at
(
0
)
->
get_argument
(
0
));
...
...
@@ -2495,9 +2495,9 @@ TEST(cpu_fusion, loop_kernel_fusion_bounded_relu)
};
pass::Manager pass_manager;
pass_manager.register_pass<pass::VisualizeTree>("before_relu_fusion.p
df
");
pass_manager.register_pass<pass::VisualizeTree>("before_relu_fusion.p
ng
");
pass_manager.register_pass<runtime::cpu::pass::CPULoopKernelFusion>(3);
pass_manager.register_pass<pass::VisualizeTree>("after_relu_fusion.p
df
");
pass_manager.register_pass<pass::VisualizeTree>("after_relu_fusion.p
ng
");
auto cpu_f = make_function();
auto int_f = make_function();
pass_manager.run_passes(cpu_f);
...
...
test/reshape_elimination.cpp
View file @
2ffbfb1f
...
...
@@ -139,9 +139,9 @@ TEST(reshape_elimination, recurrent_reshapes)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>("after_recurrent_reshapes.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("after_recurrent_reshapes.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -188,11 +188,11 @@ TEST(reshape_elimination, recurrent_reshapes_elimination)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes_elimination.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes_elimination.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>("after_1_recurrent_reshapes_elimination.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("after_1_recurrent_reshapes_elimination.p
ng
");
pass_manager
.
register_pass
<
pass
::
ReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>("after_2_recurrent_reshapes_elimination.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("after_2_recurrent_reshapes_elimination.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -229,9 +229,9 @@ TEST(reshape_elimination, recurrent_reshapes_fan_out)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes_fan_out.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes_fan_out.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>("after_recurrent_reshapes_fan_out.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("after_recurrent_reshapes_fan_out.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -269,9 +269,9 @@ TEST(reshape_elimination, recurrent_reshapes_fan_out_at_end)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes_fan_out_at_end.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("before_recurrent_reshapes_fan_out_at_end.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>("after_recurrent_reshapes_fan_out_at_end.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("after_recurrent_reshapes_fan_out_at_end.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -318,10 +318,10 @@ TEST(reshape_elimination, recurrent_reshapes_multiple_fusions)
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>(
// "before_recurrent_reshapes_multiple_fusions.p
df
");
// "before_recurrent_reshapes_multiple_fusions.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>(
// "after_recurrent_reshapes_multiple_fusions.p
df
");
// "after_recurrent_reshapes_multiple_fusions.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -360,9 +360,9 @@ TEST(reshape_elimination, nonrecurrent_reshapes)
auto
baseline_input_shape
=
baseline_f
->
get_parameters
().
at
(
0
)
->
get_shape
();
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>("before_nonrecurrent_reshapes.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("before_nonrecurrent_reshapes.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>("after_nonrecurrent_reshapes.p
df
");
// pass_manager.register_pass<pass::VisualizeTree>("after_nonrecurrent_reshapes.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
@@ -412,10 +412,10 @@ TEST(reshape_elimination, recurrent_reshapes_multiple_branches)
pass
::
Manager
pass_manager
;
// pass_manager.register_pass<pass::VisualizeTree>(
// "before_recurrent_reshapes_multiple_branches.p
df
");
// "before_recurrent_reshapes_multiple_branches.p
ng
");
pass_manager
.
register_pass
<
pass
::
RecurrentReshapeElimination
>
();
// pass_manager.register_pass<pass::VisualizeTree>(
// "after_recurrent_reshapes_multiple_branches.p
df
");
// "after_recurrent_reshapes_multiple_branches.p
ng
");
pass_manager
.
run_passes
(
optimized_f
);
test
::
Uniform
<
float
>
rng
(
0.0
f
,
100.0
f
);
...
...
test/reshape_sinking.cpp
View file @
2ffbfb1f
...
...
@@ -61,11 +61,11 @@ TEST(reshape_sinking, edge_splitting)
auto
func
=
make_shared
<
Function
>
(
NodeVector
{
absn2
,
sum
},
ParameterVector
{
a
});
pass
::
Manager
pass_manager
;
//size_t before_count = count_ops_of_type<op::Reshape>(func);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ReshapeSinking
>
();
pass_manager
.
register_pass
<
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
pass
::
CommonSubexpressionElimination
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
pass_manager
.
run_passes
(
func
);
ASSERT_EQ
(
func
->
get_results
().
at
(
1
)
->
get_argument
(
0
),
sum
);
auto
new_reshape
=
...
...
@@ -119,13 +119,13 @@ TEST(reshape_sinking, mnist_conv)
shared_ptr
<
Function
>
func
=
ngraph
::
deserialize
(
ss
);
pass
::
Manager
pass_manager
;
size_t
before_count
=
count_ops_of_type
<
op
::
Reshape
>
(
func
);
//pass_manager.register_pass<pass::VisualizeTree>("before.p
df
");
//pass_manager.register_pass<pass::VisualizeTree>("before.p
ng
");
pass_manager
.
register_pass
<
pass
::
ReshapeSinking
>
();
pass_manager
.
register_pass
<
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
pass
::
CommonSubexpressionElimination
>
();
//pass_manager.register_pass<pass::CoreFusion>();
//pass_manager.register_pass<runtime::cpu::pass::CPUFusion>();
//pass_manager.register_pass<pass::VisualizeTree>("after.p
df
");
//pass_manager.register_pass<pass::VisualizeTree>("after.p
ng
");
pass_manager
.
run_passes
(
func
);
size_t
before_after
=
count_ops_of_type
<
op
::
Reshape
>
(
func
);
ASSERT_LE
(
before_after
,
before_count
);
...
...
@@ -154,11 +154,11 @@ TEST(reshape_sinking, nasnet_pooladd)
pass
::
Manager
pass_manager
;
size_t
before_count
=
count_ops_of_type
<
op
::
Reshape
>
(
func
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ReshapeSinking
>
();
pass_manager
.
register_pass
<
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
pass
::
CommonSubexpressionElimination
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
pass_manager
.
run_passes
(
func
);
size_t
before_after
=
count_ops_of_type
<
op
::
Reshape
>
(
func
);
ASSERT_LE
(
before_after
,
before_count
);
...
...
@@ -192,11 +192,11 @@ TEST(reshape_sinking, slice_pad)
pass
::
Manager
pass_manager
;
size_t
before_count
=
count_ops_of_type
<
op
::
Reshape
>
(
f
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ReshapeSinking
>
();
pass_manager
.
register_pass
<
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
pass
::
CommonSubexpressionElimination
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
pass_manager
.
run_passes
(
f
);
size_t
before_after
=
count_ops_of_type
<
op
::
Reshape
>
(
f
);
ASSERT_LE
(
before_after
,
before_count
);
...
...
@@ -265,11 +265,11 @@ TEST(reshape_sinking, concat)
auto
f
=
make_shared
<
Function
>
(
reshape_conv2
,
ParameterVector
{
A_
,
A1_
});
pass
::
Manager
pass_manager
;
size_t
before_count
=
count_ops_of_type
<
op
::
Reshape
>
(
f
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"before.p
ng
"
);
pass_manager
.
register_pass
<
pass
::
ReshapeSinking
>
();
pass_manager
.
register_pass
<
pass
::
ReshapeElimination
>
();
pass_manager
.
register_pass
<
pass
::
CommonSubexpressionElimination
>
();
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
df
"
);
pass_manager
.
register_pass
<
pass
::
VisualizeTree
>
(
"after.p
ng
"
);
pass_manager
.
run_passes
(
f
);
size_t
before_after
=
count_ops_of_type
<
op
::
Reshape
>
(
f
);
ASSERT_LE
(
before_after
,
before_count
);
...
...
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