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
745c350a
Commit
745c350a
authored
Oct 12, 2017
by
Scott Cyphers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use older insert
parent
bc3c70df
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
adjoints.cpp
src/ngraph/autodiff/adjoints.cpp
+3
-3
node.cpp
src/ngraph/node.cpp
+1
-1
No files found.
src/ngraph/autodiff/adjoints.cpp
View file @
745c350a
...
@@ -148,7 +148,7 @@ std::shared_ptr<Node> autodiff::Adjoints::get(const std::shared_ptr<Node>& x)
...
@@ -148,7 +148,7 @@ std::shared_ptr<Node> autodiff::Adjoints::get(const std::shared_ptr<Node>& x)
if
(
m_adjoint_map
.
end
()
==
adjoint_it
)
if
(
m_adjoint_map
.
end
()
==
adjoint_it
)
{
{
auto
result
=
make_zero
(
x
->
get_value_type
());
auto
result
=
make_zero
(
x
->
get_value_type
());
adjoint_it
=
m_adjoint_map
.
insert
(
std
::
make_tuple
(
x
.
get
(),
result
)
).
first
;
adjoint_it
=
m_adjoint_map
.
insert
(
{
x
.
get
(),
result
}
).
first
;
}
}
return
adjoint_it
->
second
;
return
adjoint_it
->
second
;
}
}
...
@@ -160,11 +160,11 @@ void autodiff::Adjoints::add_delta(const std::shared_ptr<Node>& x,
...
@@ -160,11 +160,11 @@ void autodiff::Adjoints::add_delta(const std::shared_ptr<Node>& x,
auto
adjoint_it
=
m_adjoint_map
.
find
(
x
.
get
());
auto
adjoint_it
=
m_adjoint_map
.
find
(
x
.
get
());
if
(
m_adjoint_map
.
end
()
==
adjoint_it
)
if
(
m_adjoint_map
.
end
()
==
adjoint_it
)
{
{
m_adjoint_map
.
insert
(
std
::
make_tuple
(
x
.
get
(),
delta
)
);
m_adjoint_map
.
insert
({
x
.
get
(),
delta
}
);
}
}
else
else
{
{
m_adjoint_map
.
insert
(
m_adjoint_map
.
insert
(
std
::
make_tuple
(
x
.
get
(),
std
::
make_shared
<
op
::
Add
>
(
adjoint_it
->
second
,
delta
))
);
{
x
.
get
(),
std
::
make_shared
<
op
::
Add
>
(
adjoint_it
->
second
,
delta
)}
);
}
}
}
}
src/ngraph/node.cpp
View file @
745c350a
...
@@ -167,7 +167,7 @@ std::shared_ptr<Node> Node::backwards_derivative(const std::shared_ptr<Node>& x,
...
@@ -167,7 +167,7 @@ std::shared_ptr<Node> Node::backwards_derivative(const std::shared_ptr<Node>& x,
{
{
adjoints_it
=
adjoints_it
=
m_adjoint_map
m_adjoint_map
.
insert
(
std
::
make_tuple
(
c
.
get
(),
autodiff
::
Adjoints
(
shared_from_this
(),
c
))
)
.
insert
({
c
.
get
(),
autodiff
::
Adjoints
(
shared_from_this
(),
c
)}
)
.
first
;
.
first
;
}
}
return
adjoints_it
->
second
.
get
(
x
);
return
adjoints_it
->
second
.
get
(
x
);
...
...
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