nswamy commented on a change in pull request #14372: Memory fixes. Resolves
#10867, and resolves #14080
URL: https://github.com/apache/incubator-mxnet/pull/14372#discussion_r269743477
##########
File path:
scala-package/core/src/main/scala/org/apache/mxnet/ResourceScope.scala
##########
@@ -160,6 +162,17 @@ object ResourceScope {
}
}
+ private[mxnet] def usingIfScopeExists[A](scope: Option[ResourceScope])(body:
=> A): A = {
+ if (scope == None) {
+ body
+ } else {
+ ResourceScope.addToThreadLocal(scope.get)
Review comment:
why add it to ThreadLocal again? can you elaborate, it looks hacky to me.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services