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
07ba1bef
Unverified
Commit
07ba1bef
authored
Jan 06, 2018
by
Matthew Brookhart
Committed by
GitHub
Jan 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix boolean ops to return the input element::type instead of float32 (#356)
parent
8c4ae5ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
maximum.cpp
src/ngraph/ops/maximum.cpp
+2
-3
minimum.cpp
src/ngraph/ops/minimum.cpp
+4
-4
select.cpp
src/ngraph/ops/select.cpp
+5
-4
No files found.
src/ngraph/ops/maximum.cpp
View file @
07ba1bef
...
...
@@ -28,9 +28,8 @@ void ngraph::op::Maximum::generate_adjoints(autodiff::Adjoints& adjoints,
{
auto
x
=
get_input_op
(
0
);
auto
y
=
get_input_op
(
1
);
adjoints
.
add_delta
(
x
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Greater
>
(
x
,
y
),
element
::
f32
));
x
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Greater
>
(
x
,
y
),
x
->
get_element_type
()
));
adjoints
.
add_delta
(
y
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Greater
>
(
y
,
x
),
element
::
f32
));
y
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Greater
>
(
y
,
x
),
y
->
get_element_type
()
));
}
src/ngraph/ops/minimum.cpp
View file @
07ba1bef
...
...
@@ -29,8 +29,8 @@ void ngraph::op::Minimum::generate_adjoints(autodiff::Adjoints& adjoints,
auto
x
=
get_input_op
(
0
);
auto
y
=
get_input_op
(
1
);
adjoints
.
add_delta
(
x
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Less
>
(
x
,
y
),
element
::
f32
));
adjoints
.
add_delta
(
y
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Less
>
(
y
,
x
),
element
::
f32
));
adjoints
.
add_delta
(
x
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Less
>
(
x
,
y
),
x
->
get_element_type
()
));
adjoints
.
add_delta
(
y
,
delta
*
make_shared
<
op
::
Convert
>
(
make_shared
<
op
::
Less
>
(
y
,
x
),
y
->
get_element_type
()
));
}
src/ngraph/ops/select.cpp
View file @
07ba1bef
...
...
@@ -56,9 +56,10 @@ void ngraph::op::Select::generate_adjoints(autodiff::Adjoints& adjoints,
auto
x
=
get_inputs
().
at
(
1
).
get_output
().
get_node
();
auto
y
=
get_inputs
().
at
(
2
).
get_output
().
get_node
();
auto
p_as_float
=
std
::
make_shared
<
op
::
Convert
>
(
p
,
element
::
f32
);
auto
not_p_as_float
=
std
::
make_shared
<
op
::
Convert
>
(
std
::
make_shared
<
op
::
Not
>
(
p
),
element
::
f32
);
auto
p_as_x_type
=
std
::
make_shared
<
op
::
Convert
>
(
p
,
x
->
get_element_type
());
auto
not_p_as_y_type
=
std
::
make_shared
<
op
::
Convert
>
(
std
::
make_shared
<
op
::
Not
>
(
p
),
y
->
get_element_type
());
adjoints
.
add_delta
(
x
,
delta
*
p_as_
float
);
adjoints
.
add_delta
(
y
,
delta
*
not_p_as_
float
);
adjoints
.
add_delta
(
x
,
delta
*
p_as_
x_type
);
adjoints
.
add_delta
(
y
,
delta
*
not_p_as_
y_type
);
}
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