mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] liuzx32 commented on a change in pull request #11204: Scala inference memory leak fix
Date Mon, 11 Jun 2018 11:36:03 GMT
liuzx32 commented on a change in pull request #11204: Scala inference memory leak fix
URL: https://github.com/apache/incubator-mxnet/pull/11204#discussion_r194373148
 
 

 ##########
 File path: scala-package/core/src/main/scala/org/apache/mxnet/FeedForward.scala
 ##########
 @@ -230,8 +230,11 @@ class FeedForward private(
       val padded = batch.pad
       val realSize = batchSize - padded
       for ((list, nd) <- outputs zip predExec.outputs) {
-        list += nd.slice(0, realSize).copy()
+        val ndSliced = nd.slice(0, realSize)
+        list += ndSliced.copy()
+        ndSliced.dispose()
 
 Review comment:
   @lanking520 Can you show the exception information?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message