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
2e42fe27
Unverified
Commit
2e42fe27
authored
Nov 11, 2017
by
Scott Cyphers
Committed by
GitHub
Nov 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into cyphers/adiffinout
parents
125b1a85
5fe18494
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
op.cpp
src/ngraph/ops/op.cpp
+2
-1
type_prop.cpp
test/type_prop.cpp
+23
-15
No files found.
src/ngraph/ops/op.cpp
View file @
2e42fe27
...
...
@@ -31,7 +31,8 @@ op::RequiresTensorViewArgs::RequiresTensorViewArgs(const std::string& node_type,
{
if
(
nullptr
==
std
::
dynamic_pointer_cast
<
const
TensorViewType
>
(
arg
->
get_value_type
()))
{
throw
ngraph_error
(
"Arguments must be tensor views"
);
throw
ngraph_error
(
"Arguments for node type
\"
"
+
node_type
+
"
\"
must be tensor views"
);
}
}
}
test/type_prop.cpp
View file @
2e42fe27
...
...
@@ -75,7 +75,8 @@ TEST(type_prop, broadcast_bad_arguments)
}
catch
(
const
ngraph_error
&
error
)
{
EXPECT_EQ
(
error
.
what
(),
std
::
string
(
"Arguments must be tensor views"
));
EXPECT_EQ
(
error
.
what
(),
std
::
string
(
"Arguments for node type
\"
Broadcast
\"
must be tensor views"
));
}
catch
(...)
{
...
...
@@ -382,7 +383,8 @@ TEST(type_prop, dot_deduce_reduction_axes_size_mismatch)
//
// Tests for binary elementwise ops.
//
void
test_binary
(
shared_ptr
<
Node
>
(
f
)(
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
))
void
test_binary
(
std
::
string
node_type
,
shared_ptr
<
Node
>
(
f
)(
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
))
{
// Check for bad arguments
auto
tp0_param
=
make_shared
<
op
::
Parameter
>
(
make_shared
<
TupleType
>
());
...
...
@@ -407,7 +409,9 @@ void test_binary(shared_ptr<Node>(f)(const shared_ptr<Node>& x, const shared_ptr
}
catch
(
const
ngraph_error
&
error
)
{
EXPECT_EQ
(
error
.
what
(),
std
::
string
(
"Arguments must be tensor views"
));
EXPECT_EQ
(
error
.
what
(),
std
::
string
(
"Arguments for node type
\"
"
+
node_type
+
"
\"
must be tensor views"
));
}
catch
(...)
{
...
...
@@ -469,30 +473,34 @@ void test_binary(shared_ptr<Node>(f)(const shared_ptr<Node>& x, const shared_ptr
TEST
(
type_prop
,
add_bad_arguments
)
{
test_binary
([](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Add
>
(
x
,
y
);
});
test_binary
(
"Add"
,
[](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Add
>
(
x
,
y
);
});
}
TEST
(
type_prop
,
divide_bad_arguments
)
{
test_binary
([](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Divide
>
(
x
,
y
);
});
test_binary
(
"Divide"
,
[](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Divide
>
(
x
,
y
);
});
}
TEST
(
type_prop
,
multiply_bad_arguments
)
{
test_binary
([](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Multiply
>
(
x
,
y
);
});
test_binary
(
"Multiply"
,
[](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Multiply
>
(
x
,
y
);
});
}
TEST
(
type_prop
,
subtract_bad_arguments
)
{
test_binary
([](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Subtract
>
(
x
,
y
);
});
test_binary
(
"Subtract"
,
[](
const
shared_ptr
<
Node
>&
x
,
const
shared_ptr
<
Node
>&
y
)
->
shared_ptr
<
Node
>
{
return
make_shared
<
op
::
Subtract
>
(
x
,
y
);
});
}
TEST
(
type_prop
,
comparison_good
)
...
...
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