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
a7c5eb01
Commit
a7c5eb01
authored
Jul 05, 2018
by
Nick Korovaiko
Committed by
Scott Cyphers
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make logical ops input type aware (#1203)
parent
f1ebcd3e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
20 deletions
+17
-20
int_backend.hpp
src/ngraph/runtime/interpreter/int_backend.hpp
+8
-9
and.hpp
src/ngraph/runtime/reference/and.hpp
+3
-3
not.hpp
src/ngraph/runtime/reference/not.hpp
+3
-5
or.hpp
src/ngraph/runtime/reference/or.hpp
+3
-3
No files found.
src/ngraph/runtime/interpreter/int_backend.hpp
View file @
a7c5eb01
...
...
@@ -202,9 +202,9 @@ private:
#endif
else
if
(
node_op
==
"And"
)
{
reference
::
logical_and
(
args
[
0
]
->
get_data_ptr
<
char
>
(),
args
[
1
]
->
get_data_ptr
<
char
>
(),
out
[
0
]
->
get_data_ptr
<
char
>
(),
reference
::
logical_and
(
args
[
0
]
->
get_data_ptr
<
T
>
(),
args
[
1
]
->
get_data_ptr
<
T
>
(),
out
[
0
]
->
get_data_ptr
<
T
>
(),
out
[
0
]
->
get_element_count
());
}
else
if
(
node_op
==
"Asin"
)
...
...
@@ -633,9 +633,8 @@ private:
}
else
if
(
node_op
==
"Not"
)
{
reference
::
logical_not
(
args
[
0
]
->
get_data_ptr
<
char
>
(),
out
[
0
]
->
get_data_ptr
<
char
>
(),
out
[
0
]
->
get_element_count
());
reference
::
logical_not
(
args
[
0
]
->
get_data_ptr
<
T
>
(),
out
[
0
]
->
get_data_ptr
<
T
>
(),
out
[
0
]
->
get_element_count
());
}
else
if
(
node_op
==
"NotEqual"
)
{
...
...
@@ -655,9 +654,9 @@ private:
}
else
if
(
node_op
==
"Or"
)
{
reference
::
logical_or
(
args
[
0
]
->
get_data_ptr
<
char
>
(),
args
[
1
]
->
get_data_ptr
<
char
>
(),
out
[
0
]
->
get_data_ptr
<
char
>
(),
reference
::
logical_or
(
args
[
0
]
->
get_data_ptr
<
T
>
(),
args
[
1
]
->
get_data_ptr
<
T
>
(),
out
[
0
]
->
get_data_ptr
<
T
>
(),
out
[
0
]
->
get_element_count
());
}
else
if
(
node_op
==
"Parameter"
)
...
...
src/ngraph/runtime/reference/and.hpp
View file @
a7c5eb01
...
...
@@ -24,12 +24,12 @@ namespace ngraph
{
namespace
reference
{
static
inline
void
logical_and
(
const
char
*
arg0
,
const
char
*
arg1
,
char
*
out
,
size_t
count
)
template
<
typename
T
>
void
logical_and
(
const
T
*
arg0
,
const
T
*
arg1
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
arg0
[
i
]
&&
arg1
[
i
]
;
out
[
i
]
=
static_cast
<
T
>
(
arg0
[
i
]
&&
arg1
[
i
])
;
}
}
}
...
...
src/ngraph/runtime/reference/not.hpp
View file @
a7c5eb01
...
...
@@ -24,14 +24,12 @@ namespace ngraph
{
namespace
reference
{
static
inline
void
logical_not
(
const
char
*
arg
,
char
*
out
,
size_t
count
)
// TODO: using char for bool, is this right?
template
<
typename
T
>
void
logical_not
(
const
T
*
arg
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
!
(
arg
[
i
]
);
out
[
i
]
=
static_cast
<
T
>
(
!
(
arg
[
i
])
);
}
}
}
...
...
src/ngraph/runtime/reference/or.hpp
View file @
a7c5eb01
...
...
@@ -24,12 +24,12 @@ namespace ngraph
{
namespace
reference
{
static
inline
void
logical_or
(
const
char
*
arg0
,
const
char
*
arg1
,
char
*
out
,
size_t
count
)
template
<
typename
T
>
void
logical_or
(
const
T
*
arg0
,
const
T
*
arg1
,
T
*
out
,
size_t
count
)
{
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
arg0
[
i
]
||
arg1
[
i
]
;
out
[
i
]
=
static_cast
<
T
>
(
arg0
[
i
]
||
arg1
[
i
])
;
}
}
}
...
...
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