You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/01 09:04:09 UTC

[GitHub] calumleslie commented on a change in pull request #8887: Remove finalizers from Scala API

calumleslie commented on a change in pull request #8887: Remove finalizers from Scala API
URL: https://github.com/apache/incubator-mxnet/pull/8887#discussion_r154295649
 
 

 ##########
 File path: scala-package/core/src/main/scala/ml/dmlc/mxnet/module/DataParallelExecutorGroup.scala
 ##########
 @@ -312,8 +312,12 @@ class DataParallelExecutorGroup private[module](
     if (labelShapes != None) decideSlices(labelShapes.get)
     else null
 
-  private val outputLayouts = symbol.listOutputs().map(name =>
-    DataDesc.getBatchAxis(symbol.get(name).attr("__layout__"))
+  private val outputLayouts = symbol.listOutputs().map(name => {
+    val sym = symbol.get(name)
 
 Review comment:
   `symbol.get` returns a [new Symbol value](https://github.com/apache/incubator-mxnet/blob/master/scala-package/core/src/main/scala/ml/dmlc/mxnet/Symbol.scala#L99-L103) each time. Since that Symbol falls out of scope here, we can't reuse it. I believe because a new handle is retrieved in `symbol.get` that this shouldn't cause an issue elsewhere.

----------------------------------------------------------------
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