Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
d0cc035c
Commit
d0cc035c
authored
Sep 12, 2016
by
Eric Junyuan Xie
Committed by
Tianqi Chen
May 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix inplace. Only permit shared when shape and dtype is the same (#45)
parent
2c0b79ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletions
+4
-1
nnvm/src/pass/plan_memory.cc
+4
-1
No files found.
nnvm/src/pass/plan_memory.cc
View file @
d0cc035c
...
...
@@ -173,7 +173,10 @@ Graph PlanMemory(Graph ret) {
for
(
auto
&
kv
:
inplace_pairs
)
{
uint32_t
eid_out
=
idx
.
entry_id
(
nid
,
kv
.
second
);
uint32_t
eid_in
=
idx
.
entry_id
(
inode
.
inputs
[
kv
.
first
]);
if
(
ref_count
[
eid_in
]
==
1
&&
storage
[
eid_in
]
!=
GraphAllocator
::
kBadStorageID
)
{
if
(
ref_count
[
eid_in
]
==
1
&&
storage
[
eid_in
]
!=
GraphAllocator
::
kBadStorageID
&&
shape_vec
[
eid_out
].
Size
()
==
shape_vec
[
eid_in
].
Size
()
&&
dtype_vec
[
eid_out
]
==
dtype_vec
[
eid_in
])
{
// inplace optimization
storage
[
eid_out
]
=
storage
[
eid_in
];
ref_count
[
eid_in
]
=
0
;
...
...
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