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
37849092
Commit
37849092
authored
Nov 16, 2019
by
Amy Zhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address PR feedback.
parent
bb400712
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
constant_folding_gather.cpp
src/ngraph/pass/constant_folding_gather.cpp
+1
-1
constant_folding.cpp
test/constant_folding.cpp
+4
-4
No files found.
src/ngraph/pass/constant_folding_gather.cpp
View file @
37849092
...
...
@@ -105,7 +105,7 @@ void pass::ConstantFolding::construct_constant_gather()
auto
indices_label
=
make_shared
<
pattern
::
op
::
Label
>
(
element
::
i64
,
Shape
{
5
},
pattern
::
has_class
<
op
::
Constant
>
());
size_t
gather_axis
=
1
;
auto
gather_v0
=
make_shared
<
op
::
Gather
>
(
data_label
,
indices_label
,
gather_axis
);
auto
gather_v0
=
make_shared
<
op
::
v0
::
Gather
>
(
data_label
,
indices_label
,
gather_axis
);
auto
axis_label
=
make_shared
<
pattern
::
op
::
Label
>
(
element
::
i64
,
Shape
{
1
},
pattern
::
has_class
<
op
::
Constant
>
());
...
...
test/constant_folding.cpp
View file @
37849092
...
...
@@ -1399,14 +1399,14 @@ TEST(constant_folding, const_gather)
auto
constant_indices
=
op
::
Constant
::
create
(
element
::
i64
,
Shape
{
4
},
vector
<
int64_t
>
{
0
,
3
,
2
,
2
});
size_t
gather_axis
=
1
;
auto
gather
=
make_shared
<
op
::
Gather
>
(
constant_data
,
constant_indices
,
gather_axis
);
auto
gather
=
make_shared
<
op
::
v0
::
Gather
>
(
constant_data
,
constant_indices
,
gather_axis
);
auto
f
=
make_shared
<
Function
>
(
gather
,
ParameterVector
{});
pass
::
Manager
pass_manager
;
pass_manager
.
register_pass
<
pass
::
ConstantFolding
>
();
pass_manager
.
run_passes
(
f
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
Gather
>
(
f
),
0
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
v0
::
Gather
>
(
f
),
0
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
Constant
>
(
f
),
1
);
auto
new_const
=
as_type_ptr
<
op
::
Constant
>
(
f
->
get_results
().
at
(
0
)
->
get_argument
(
0
));
...
...
@@ -1434,7 +1434,7 @@ TEST(constant_folding, const_gather_v1)
pass_manager
.
register_pass
<
pass
::
ConstantFolding
>
();
pass_manager
.
run_passes
(
f
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
Gather
>
(
f
),
0
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
v1
::
Gather
>
(
f
),
0
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
Constant
>
(
f
),
1
);
auto
new_const
=
as_type_ptr
<
op
::
Constant
>
(
f
->
get_results
().
at
(
0
)
->
get_argument
(
0
));
...
...
@@ -1462,7 +1462,7 @@ TEST(constant_folding, const_gather_v1_scalar)
pass_manager
.
register_pass
<
pass
::
ConstantFolding
>
();
pass_manager
.
run_passes
(
f
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
Gather
>
(
f
),
0
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
v1
::
Gather
>
(
f
),
0
);
ASSERT_EQ
(
count_ops_of_type
<
op
::
Constant
>
(
f
),
1
);
auto
new_const
=
as_type_ptr
<
op
::
Constant
>
(
f
->
get_results
().
at
(
0
)
->
get_argument
(
0
));
...
...
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