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 2019/05/07 22:26:05 UTC

[GitHub] [incubator-mxnet] szha commented on a change in pull request #14252: Allow clearing gpu cache

szha commented on a change in pull request #14252: Allow clearing gpu cache
URL: https://github.com/apache/incubator-mxnet/pull/14252#discussion_r281853094
 
 

 ##########
 File path: python/mxnet/context.py
 ##########
 @@ -145,6 +145,24 @@ def default_ctx(cls, val):
         cls._default_ctx.value = val
     #pylint: enable=no-self-argument
 
+    def empty_cache(self):
+        """Empties the memory cache for the current contexts device.
+
+		MXNet utilizes a memory pool to avoid excessive allocations.
+		Calling empty_cache will empty the memory pool of the contexts
+		device. This will only free the memory of unreferenced data.
+
+        Examples
+        -------
+		>>> ctx = mx.gpu(0)
 
 Review comment:
   indentation

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services