anirudh2290 commented on a change in pull request #10354: Expose the number of 
GPUs.
URL: https://github.com/apache/incubator-mxnet/pull/10354#discussion_r180568314
 
 

 ##########
 File path: python/mxnet/context.py
 ##########
 @@ -212,6 +216,25 @@ def gpu(device_id=0):
     return Context('gpu', device_id)
 
 
+def num_gpus():
+    """Query CUDA for the number of GPUs present.
+
+    Raises
+    ------
+    Will raise an exception on any CUDA error or in case MXNet was not
+    compiled with CUDA support.
+
+
+    Returns
+    -------
+    count : int
+        The number of GPUs.
+ 
 
 Review comment:
   nit: remove whitespace

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


With regards,
Apache Git Services

Reply via email to