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
478a94f9
Commit
478a94f9
authored
6 years ago
by
Nick Korovaiko
Committed by
Scott Cyphers
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename Any to Skip since that is exactly what it should have been called from the beginning (#891)
* any -> skip * run style check
parent
870200d1
master
v0.29.0-rc.0
v0.28.0-rc.1
v0.28.0-rc.0
v0.27.1-rc.3
v0.27.1-rc.2
v0.27.1-rc.1
v0.27.1-rc.0
v0.27.0-rc.1
v0.27.0-rc.0
v0.26.1-rc.0
v0.26.0
v0.26.0-rc.8
v0.26.0-rc.7
v0.26.0-rc.6
v0.26.0-rc.5
v0.26.0-rc.4
v0.26.0-rc.3
v0.26.0-rc.2
v0.26.0-rc.0
v0.25.1-rc.11
v0.25.1-rc.10
v0.25.1-rc.9
v0.25.1-rc.8
v0.25.1-rc.7
v0.25.1-rc.6
v0.25.1-rc.5
v0.25.1-rc.4
v0.25.1-rc.3
v0.25.1-rc.2
v0.25.1-rc.1
v0.25.1-rc.0
v0.25.0
v0.25.0-rc.3
v0.25.0-rc.2
v0.25.0-rc.1
v0.25.0-rc.0
v0.25.0-dev.0
v0.24.0
v0.24.0-rc.3
v0.24.0-rc.2
v0.24.0-rc.1
v0.24.0-rc.0
v0.23.0-rc.7
v0.23.0-rc.6
v0.23.0-rc.5
v0.23.0-rc.4
v0.23.0-rc.3
v0.23.0-rc.2
v0.23.0-rc.1
v0.23.0-rc.0
v0.22.2-rc.0
v0.22.1
v0.22.1-rc.0
v0.22.0
v0.22.0-rc.2
v0.22.0-rc.0
v0.21.0
v0.21.0-rc.1
v0.21.0-rc.0
v0.20.1-rc.4
v0.20.1-rc.3
v0.20.1-rc.2
v0.20.1-rc.1
v0.20.1-rc.0
v0.20.0-rc.2
v0.20.0-rc.1
v0.20.0-rc.0
v0.20.0-dev.0
v0.19.1
v0.19.1-rc.0
v0.19.0
v0.19.0-rc.5
v0.19.0-rc.4
v0.19.0-rc.3
v0.19.0-rc.2
v0.19.0-rc.1
v0.19.0-rc.0
v0.18.1
v0.18.1-rc.1
v0.18.1-rc.0
v0.18.0
v0.18.0-rc.2
v0.18.0-rc.1
v0.18.0-rc.0
v0.17.0-rc.1
v0.17.0-rc.0
v0.16.0-rc.3
v0.16.0-rc.2
v0.16.0-rc.1
v0.16.0-rc.0
v0.15.1-rc.2
v0.15.1-rc.1
v0.15.0
v0.15.0-rc.2
v0.15.0-rc.1
v0.15.0-rc.0
v0.14.0
v0.14.0-rc.1
v0.14.0-rc.0
v0.13.0
v0.12.0
v0.12.0-rc.2
v0.12.0-rc.1
v0.12.0-rc.0
v0.11.1
v0.11.0
v0.11.0-rc.1
v0.11.0-rc.0
v0.10.1
v0.10.0
v0.10.0-rc.6
v0.10.0-rc.5
v0.10.0-rc.4
v0.10.0-rc.3
v0.10.0-rc.2
v0.10.0-rc.1
v0.10.0-rc.0
v0.9.1
v0.9.1-rc.0
v0.9.0
v0.9.0-rc.5
v0.9.0-rc.4
v0.9.0-rc.3
v0.9.0-rc.2
v0.9.0-rc.1
v0.9.0-rc.0
v0.8.2-rc.0
v0.8.1
v0.8.1-rc.0
v0.8.0
v0.8.0-rc.2
v0.8.0-rc.1
v0.8.0-rc.0
v0.7.0
v0.6.0
v0.6.0rc0
v0.6.0-rc.0
v0.6.0-rc0
v0.5.0
v0.4.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
28 additions
and
28 deletions
+28
-28
core_fusion.cpp
src/ngraph/pass/core_fusion.cpp
+2
-2
reshape_elimination.cpp
src/ngraph/pass/reshape_elimination.cpp
+1
-1
matcher.cpp
src/ngraph/pattern/matcher.cpp
+5
-5
matcher.hpp
src/ngraph/pattern/matcher.hpp
+2
-2
pattern.hpp
src/ngraph/pattern/op/pattern.hpp
+1
-1
skip.hpp
src/ngraph/pattern/op/skip.hpp
+4
-4
cpu_fusion.cpp
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
+3
-3
cpu_post_layout_optimizations.cpp
...ngraph/runtime/cpu/pass/cpu_post_layout_optimizations.cpp
+1
-1
core_fusion.cpp
test/core_fusion.cpp
+1
-1
cpu_fusion.cpp
test/cpu_fusion.cpp
+3
-3
includes.cpp
test/includes.cpp
+1
-1
pattern.cpp
test/pattern.cpp
+3
-3
reshape_elimination.cpp
test/reshape_elimination.cpp
+1
-1
No files found.
src/ngraph/pass/core_fusion.cpp
View file @
478a94f9
...
...
@@ -29,8 +29,8 @@
#include "ngraph/pass/graph_rewrite.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
using
namespace
ngraph
;
using
namespace
std
;
...
...
@@ -55,7 +55,7 @@ void pass::CoreFusion::construct_relu_pattern()
auto
broadcast_pred
=
[](
std
::
shared_ptr
<
Node
>
n
)
{
return
static_cast
<
bool
>
(
std
::
dynamic_pointer_cast
<
op
::
Broadcast
>
(
n
));
};
auto
skip_broadcast
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
zero
,
broadcast_pred
);
auto
skip_broadcast
=
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
zero
,
broadcast_pred
);
auto
max
=
make_shared
<
op
::
Maximum
>
(
skip_broadcast
,
val
);
pattern
::
graph_rewrite_callback
callback
=
[
val
,
zero
](
pattern
::
Matcher
&
m
)
{
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/pass/reshape_elimination.cpp
View file @
478a94f9
...
...
@@ -29,8 +29,8 @@
#include "ngraph/op/parameter.hpp"
#include "ngraph/op/reshape.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/util.hpp"
template
<
typename
T
>
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/pattern/matcher.cpp
View file @
478a94f9
...
...
@@ -71,7 +71,7 @@ namespace ngraph
return
is_match
;
}
bool
Matcher
::
match_
any
(
const
std
::
shared_ptr
<
op
::
Any
>&
any
,
bool
Matcher
::
match_
skip
(
const
std
::
shared_ptr
<
op
::
Skip
>&
any
,
const
std
::
shared_ptr
<
Node
>&
graph_node
,
PatternMap
&
pattern_map
)
{
...
...
@@ -86,7 +86,7 @@ namespace ngraph
auto
args
=
any
->
get_arguments
();
if
(
args
.
size
()
!=
1
)
{
throw
ngraph_error
(
"
Any
can only take one argument"
);
throw
ngraph_error
(
"
Skip
can only take one argument"
);
}
return
match_node
(
args
.
at
(
0
),
graph_node
,
pattern_map
);
...
...
@@ -111,10 +111,10 @@ namespace ngraph
return
match_pattern
(
label_node
,
graph_node
,
pattern_map
);
}
if
(
auto
any_node
=
std
::
dynamic_pointer_cast
<
op
::
Any
>
(
if
(
auto
any_node
=
std
::
dynamic_pointer_cast
<
op
::
Skip
>
(
pattern_node
))
//matches PatternSkipOp semantics
{
return
match_
any
(
any_node
,
graph_node
,
pattern_map
);
return
match_
skip
(
any_node
,
graph_node
,
pattern_map
);
}
auto
p_pattern_node
=
pattern_node
.
get
();
...
...
@@ -283,7 +283,7 @@ namespace ngraph
//pre-populate the pattern map for the next cell with the bound nodes
//from the current match. Only bound nodes whose labels are in
//correlated_patterns are pre-populated.
Any
other labels are
//correlated_patterns are pre-populated.
Skip
other labels are
//unbounded by default
for
(
auto
cor_pat
:
m_correlated_patterns
)
{
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/pattern/matcher.hpp
View file @
478a94f9
...
...
@@ -20,8 +20,8 @@
#include <memory.h>
#include "ngraph/node.hpp"
#include "ngraph/op/constant.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
namespace
ngraph
{
...
...
@@ -127,7 +127,7 @@ namespace ngraph
bool
match_pattern
(
const
std
::
shared_ptr
<
op
::
Label
>&
pattern_node
,
const
std
::
shared_ptr
<
Node
>&
graph_node
,
PatternMap
&
pattern_map
);
bool
match_
any
(
const
std
::
shared_ptr
<
op
::
Any
>&
pattern_node
,
bool
match_
skip
(
const
std
::
shared_ptr
<
op
::
Skip
>&
pattern_node
,
const
std
::
shared_ptr
<
Node
>&
graph_node
,
PatternMap
&
pattern_map
);
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/pattern/op/pattern.hpp
View file @
478a94f9
...
...
@@ -32,7 +32,7 @@ namespace ngraph
class
Pattern
:
public
Node
{
public
:
/// \brief \p a base class for \sa
Any
and \sa Label
/// \brief \p a base class for \sa
Skip
and \sa Label
///
Pattern
(
const
std
::
string
&
type_name
,
const
NodeVector
&
nodes
,
Predicate
pred
)
:
Node
(
type_name
,
nodes
)
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/pattern/op/
any
.hpp
→
src/ngraph/pattern/op/
skip
.hpp
View file @
478a94f9
...
...
@@ -25,14 +25,14 @@ namespace ngraph
{
namespace
op
{
/// \brief \p
Any
allows users to specify unexpected nodes in a pattern
/// \brief \p
Skip
allows users to specify unexpected nodes in a pattern
/// and skip them if a predicate condition is satisfied.
///
class
Any
:
public
Pattern
class
Skip
:
public
Pattern
{
public
:
Any
(
const
std
::
shared_ptr
<
Node
>&
arg
,
Predicate
predicate
=
nullptr
)
:
Pattern
(
"
Any
"
,
NodeVector
{
arg
},
predicate
)
Skip
(
const
std
::
shared_ptr
<
Node
>&
arg
,
Predicate
predicate
=
nullptr
)
:
Pattern
(
"
Skip
"
,
NodeVector
{
arg
},
predicate
)
{
add_output
(
arg
->
get_element_type
(),
arg
->
get_shape
());
}
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/cpu/pass/cpu_fusion.cpp
View file @
478a94f9
...
...
@@ -42,8 +42,8 @@
#include "ngraph/op/subtract.hpp"
#include "ngraph/op/sum.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/runtime/cpu/op/batch_norm_relu.hpp"
#include "ngraph/runtime/cpu/op/conv_bias.hpp"
#include "ngraph/runtime/cpu/op/conv_relu.hpp"
...
...
@@ -177,8 +177,8 @@ void ngraph::runtime::cpu::pass::CPUFusion::construct_matmul()
return
static_cast
<
bool
>
(
std
::
dynamic_pointer_cast
<
op
::
Reshape
>
(
n
));
};
auto
skip_w
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
W
,
reshape_pred
);
auto
skip_x
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
x
,
reshape_pred
);
auto
skip_w
=
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
W
,
reshape_pred
);
auto
skip_x
=
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
x
,
reshape_pred
);
auto
pdot
=
std
::
make_shared
<
op
::
Dot
>
(
skip_w
,
skip_x
);
...
...
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/cpu/pass/cpu_post_layout_optimizations.cpp
View file @
478a94f9
...
...
@@ -27,8 +27,8 @@
#include "ngraph/pass/graph_rewrite.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/runtime/cpu/cpu_layout_descriptor.hpp"
#include "ngraph/runtime/cpu/op/convert_layout.hpp"
#include "ngraph/runtime/cpu/pass/cpu_post_layout_optimizations.hpp"
...
...
This diff is collapsed.
Click to expand it.
test/core_fusion.cpp
View file @
478a94f9
...
...
@@ -31,8 +31,8 @@
#include "ngraph/pass/graph_rewrite.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/serializer.hpp"
#include "ngraph/util.hpp"
#include "nlohmann/json.hpp"
...
...
This diff is collapsed.
Click to expand it.
test/cpu_fusion.cpp
View file @
478a94f9
...
...
@@ -36,8 +36,8 @@
#include "ngraph/pass/reshape_elimination.hpp"
#include "ngraph/pass/visualize_tree.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/runtime/cpu/cpu_layout_descriptor.hpp"
#include "ngraph/runtime/cpu/op/batch_norm_relu.hpp"
#include "ngraph/runtime/cpu/op/conv_bias.hpp"
...
...
@@ -83,8 +83,8 @@ TEST(cpu_fusion, gemm_pattern)
return
static_cast
<
bool
>
(
std
::
dynamic_pointer_cast
<
op
::
Reshape
>
(
n
));
};
auto
skip_w
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
W
,
reshape_pred
);
auto
skip_x
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
x
,
reshape_pred
);
auto
skip_w
=
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
W
,
reshape_pred
);
auto
skip_x
=
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
x
,
reshape_pred
);
auto
pdot
=
make_shared
<
op
::
Dot
>
(
skip_w
,
skip_x
);
auto
b
=
std
::
make_shared
<
pattern
::
op
::
Label
>
(
C
);
...
...
This diff is collapsed.
Click to expand it.
test/includes.cpp
View file @
478a94f9
...
...
@@ -143,7 +143,7 @@ TEST(DISABLED_include, complete)
"ngraph/pass/visualize_tree.hpp"
,
"ngraph/pattern/core_fusion.hpp"
,
"ngraph/pattern/matcher.hpp"
,
"ngraph/pattern/op/
any
.hpp"
,
"ngraph/pattern/op/
skip
.hpp"
,
"ngraph/pattern/op/label.hpp"
,
"ngraph/pattern/op/pattern.hpp"
,
"ngraph/placement.hpp"
,
...
...
This diff is collapsed.
Click to expand it.
test/pattern.cpp
View file @
478a94f9
...
...
@@ -37,8 +37,8 @@
#include "ngraph/pass/graph_rewrite.hpp"
#include "ngraph/pass/manager.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/runtime/cpu/pass/cpu_fusion.hpp"
#include "ngraph/serializer.hpp"
#include "util/matcher.hpp"
...
...
@@ -402,11 +402,11 @@ TEST(pattern, matcher)
ASSERT_TRUE
(
n
.
match
(
a
,
a
));
auto
abs
=
make_shared
<
op
::
Abs
>
(
a
);
auto
any
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
a
);
auto
any
=
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
a
);
ASSERT_TRUE
(
n
.
match
(
any
,
abs
));
auto
any_false
=
std
::
make_shared
<
pattern
::
op
::
Any
>
(
a
,
[](
std
::
shared_ptr
<
Node
>
no
)
{
return
false
;
});
std
::
make_shared
<
pattern
::
op
::
Skip
>
(
a
,
[](
std
::
shared_ptr
<
Node
>
no
)
{
return
false
;
});
ASSERT_TRUE
(
n
.
match
(
any_false
,
a
));
auto
pattern
=
std
::
make_shared
<
pattern
::
op
::
Label
>
(
a
);
...
...
This diff is collapsed.
Click to expand it.
test/reshape_elimination.cpp
View file @
478a94f9
...
...
@@ -30,8 +30,8 @@
#include "ngraph/pass/manager.hpp"
#include "ngraph/pass/reshape_elimination.hpp"
#include "ngraph/pattern/matcher.hpp"
#include "ngraph/pattern/op/any.hpp"
#include "ngraph/pattern/op/label.hpp"
#include "ngraph/pattern/op/skip.hpp"
#include "ngraph/serializer.hpp"
#include "ngraph/util.hpp"
#include "nlohmann/json.hpp"
...
...
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