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
8518c7dd
Commit
8518c7dd
authored
6 years ago
by
Przemyslaw Tredak
Committed by
Tianqi Chen
6 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the FInplaceIdentity (#2572)
parent
fef72827
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletions
+5
-1
nnvm/src/pass/plan_memory.cc
+5
-1
No files found.
nnvm/src/pass/plan_memory.cc
View file @
8518c7dd
...
...
@@ -218,10 +218,14 @@ size_t AllocMemory(const Graph& ret, const IndexedGraph& idx,
bool
ignore_all_inputs
=
(
fignore_inputs
.
count
(
inode
.
source
->
op
())
!=
0
&&
fignore_inputs
[
inode
.
source
->
op
()](
inode
.
source
->
attrs
).
size
()
==
inode
.
source
->
num_inputs
());
// Identity should only be true if shape.Size() and types match
bool
real_identity
=
identity
[
ipair
]
&&
shape_vec
[
eid_out
].
Size
()
==
shape_vec
[
eid_in
].
Size
()
&&
dtype_vec
[
eid_out
]
==
dtype_vec
[
eid_in
];
if
(
taken
[
kv
.
first
]
==
false
&&
sid_out
==
GraphAllocator
::
kBadStorageID
&&
sid_in
>=
0
&&
((
storage_ref_count
[
sid_in
]
==
1
&&
!
ignore_all_inputs
)
||
identity
[
ipair
]
)
&&
((
storage_ref_count
[
sid_in
]
==
1
&&
!
ignore_all_inputs
)
||
real_identity
)
&&
entry_ref_count
[
eid_out
]
>
0
&&
shape_vec
[
eid_out
].
Size
()
==
shape_vec
[
eid_in
].
Size
()
&&
(
dtype_vec
[
eid_out
]
==
dtype_vec
[
eid_in
]
||
...
...
This diff is collapsed.
Click to expand it.
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