Skip to content

Commit

Permalink
Fixes Scala memory leak (apache#10436)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayres committed Jun 9, 2018
1 parent b32e04b commit 29e696a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ class FeedForward private(
val padded = batch.pad
val realSize = batchSize - padded
for ((list, nd) <- outputs zip predExec.outputs) {
list += nd.slice(0, realSize).copy()
list += nd.slice(0, realSize)
}
batch.dispose()
}
// TODO(Yizhi): we can use Symbol.concat to do the same thing. Can it be more efficient?
val results = outputs.map(NDArray.concatenate(_))
Expand Down

0 comments on commit 29e696a

Please sign in to comment.