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
9d0d7a7c
Unverified
Commit
9d0d7a7c
authored
Jan 18, 2018
by
Robert Kimball
Committed by
GitHub
Jan 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Yixing/empty tuple (#390)
* add test for empty tuple * fix null function breaking
parent
f6a578b4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
cpu_external_function.cpp
src/ngraph/runtime/cpu/cpu_external_function.cpp
+5
-0
builder_xla.cpp
test/builder_xla.cpp
+26
-0
No files found.
src/ngraph/runtime/cpu/cpu_external_function.cpp
View file @
9d0d7a7c
...
...
@@ -365,6 +365,11 @@ using namespace ngraph::runtime;
for
(
shared_ptr
<
Function
>
current_function
:
pass_manager
.
get_state
().
get_functions
())
{
const
list
<
shared_ptr
<
Node
>>&
tmp
=
current_function
->
get_ordered_ops
();
if
(
tmp
.
size
()
<
2
)
{
// Since we are comparing ops there must be at least two ops to proceed.
continue
;
}
vector
<
shared_ptr
<
Node
>>
op_list
{
tmp
.
begin
(),
tmp
.
end
()};
for
(
size_t
i
=
0
;
i
<
op_list
.
size
()
-
1
;
i
++
)
{
...
...
test/builder_xla.cpp
View file @
9d0d7a7c
...
...
@@ -72,3 +72,29 @@ TEST(builder_xla, simple)
xla
::
call
(
cf
,
{
acb
},
{
result_tuple
});
EXPECT_EQ
((
vector
<
float
>
{
50
,
72
,
98
,
128
}),
result
->
get_vector
<
float
>
());
}
TEST
(
builder_xla
,
empty_tuple_interpreter
)
{
auto
empty_tuple
=
make_shared
<
xla
::
op
::
Tuple
>
(
Nodes
{});
auto
f
=
make_shared
<
xla
::
XLAFunction
>
(
Nodes
{
empty_tuple
},
Nodes
{});
auto
manager
=
runtime
::
Manager
::
get
(
"INTERPRETER"
);
auto
external
=
manager
->
compile
(
f
);
auto
backend
=
manager
->
allocate_backend
();
auto
cf
=
backend
->
make_call_frame
(
external
);
xla
::
call
(
cf
,
{},
{});
}
TEST
(
builder_xla
,
empty_tuple_cpu
)
{
auto
empty_tuple
=
make_shared
<
xla
::
op
::
Tuple
>
(
Nodes
{});
auto
f
=
make_shared
<
xla
::
XLAFunction
>
(
Nodes
{
empty_tuple
},
Nodes
{});
auto
manager
=
runtime
::
Manager
::
get
(
"CPU"
);
auto
external
=
manager
->
compile
(
f
);
auto
backend
=
manager
->
allocate_backend
();
auto
cf
=
backend
->
make_call_frame
(
external
);
xla
::
call
(
cf
,
{},
{});
}
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