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
67163443
Commit
67163443
authored
Aug 29, 2017
by
Scott Cyphers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename comparison method
parent
3ce0e496
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
node.hpp
src/ngraph/node.hpp
+2
-2
build_graph.cpp
test/build_graph.cpp
+4
-6
No files found.
src/ngraph/node.hpp
View file @
67163443
...
...
@@ -65,11 +65,11 @@ namespace ngraph
void
name
(
const
std
::
string
&
name
)
{
m_name
=
name
;
}
/**
** Return true if this has the same implementing class as
call
. This
** Return true if this has the same implementing class as
node
. This
** will be used by the pattern matcher when comparing a pattern
** graph against the graph.
**/
bool
has_same_op
(
const
Node
::
ptr
&
node
)
const
{
return
typeid
(
*
this
)
==
typeid
(
*
node
.
get
());
}
bool
is_same_op_type
(
const
Node
::
ptr
&
node
)
const
{
return
typeid
(
*
this
)
==
typeid
(
*
node
.
get
());
}
protected
:
std
::
vector
<
Node
::
ptr
>
m_arguments
;
...
...
test/build_graph.cpp
View file @
67163443
...
...
@@ -29,11 +29,9 @@ TEST(build_graph, build_simple)
cluster_0
->
parameter
(
2
)
->
type
(
element
::
float32_t
,
{
32
,
7
});
cluster_0
->
parameter
(
3
)
->
type
(
element
::
float32_t
,
{
32
,
7
});
auto
arg3
=
cluster_0
->
parameter
(
3
);
// call broadcast op on arg3, broadcasting on axis 0.
auto
broadcast_1
=
op
::
broadcast
(
arg3
,
{
10
,
32
,
7
},
{
0
});
auto
arg2
=
cluster_0
->
parameter
(
2
);
auto
arg0
=
cluster_0
->
parameter
(
0
);
// call dot op
auto
dot
=
op
::
dot
(
arg2
,
arg0
);
ASSERT_EQ
(
dot
->
arguments
()[
0
],
arg2
);
ASSERT_EQ
(
dot
->
arguments
()[
1
],
arg0
);
...
...
@@ -61,8 +59,8 @@ TEST(build_graph, as_type)
ASSERT_EQ
(
tp_vt
,
tp_tp
);
}
// Check
Call
comparisons
TEST
(
build_graph
,
call
_comparison
)
// Check
node
comparisons
TEST
(
build_graph
,
node
_comparison
)
{
auto
fun
=
make_shared
<
Function
>
(
3
);
fun
->
parameter
(
0
)
->
type
(
element
::
float32_t
,
{
32
,
3
});
...
...
@@ -79,10 +77,10 @@ TEST(build_graph, call_comparison)
pattern
->
parameter
(
0
)
->
type
(
element
::
float32_t
,
{});
auto
parg
=
pattern
->
parameter
(
0
);
auto
pattern_dot
=
op
::
dot
(
parg
,
parg
);
ASSERT_TRUE
(
pattern_dot
->
has_same_op
(
dot
));
ASSERT_TRUE
(
pattern_dot
->
is_same_op_type
(
dot
));
// TODO This passes because typeid is not behaving as documented.
// Need to figure out what's wrong.
ASSERT_FALSE
(
pattern_dot
->
has_same_op
(
add
));
ASSERT_FALSE
(
pattern_dot
->
is_same_op_type
(
add
));
}
// Check argument inverses
...
...
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