Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
restore list_gpus() in tests_utils for compat
Browse files Browse the repository at this point in the history
  • Loading branch information
larroy committed May 24, 2019
1 parent bafb0c9 commit c7d3542
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,16 @@ def check_consistency(sym, ctx_list, scale=1.0, grad_req='write',

return gt

def list_gpus():
"""Return a list of GPUs
Returns
-------
list of int:
If there are n GPUs, then return a list [0,1,...,n-1]. Otherwise returns
[].
"""
return range(mx.util.get_gpu_count())

def download(url, fname=None, dirname=None, overwrite=False, retries=5):
"""Download an given URL
Expand Down

0 comments on commit c7d3542

Please sign in to comment.